diff --git a/CHANGELOG.md b/CHANGELOG.md index b96c4ca..b5c3f49 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ All notable changes to `guanguans/id-validator` will be documented in this file +## v1.1.11 - 2022-04-29 + +## What's Changed + +- Bump actions/cache from 2.1.7 to 3 by @dependabot in https://github.com/guanguans/id-validator/pull/21 +- Bump codecov/codecov-action from 2.1.0 to 3 by @dependabot in https://github.com/guanguans/id-validator/pull/22 + +**Full Changelog**: https://github.com/guanguans/id-validator/compare/v1.1.10...v1.1.11 + ## v1.1.10 - 2022-03-06 **Full Changelog**: https://github.com/guanguans/id-validator/compare/v1.1.9...v1.1.10 diff --git a/data/address_code_timeline.go b/data/address_code_timeline.go index 907d24a..d0ffa49 100644 --- a/data/address_code_timeline.go +++ b/data/address_code_timeline.go @@ -59,13 +59,13 @@ func GetAddressCodeTimeline(code int) ([]map[string]string, bool) { f, ok := provinceAddressCodeTimelinePluck[codeStr[:2]] if !ok { - timeline, ok := getAddressCodeTimelineOther()[code] + timeline, ok := getAddressCodeTimelineAdditional()[code] return timeline, ok } timeline, ok := f()[code] if !ok { - timeline, ok := getAddressCodeTimelineOther()[code] + timeline, ok := getAddressCodeTimelineAdditional()[code] return timeline, ok } @@ -51993,7 +51993,7 @@ func getAddressCodeTimelineTaiWan() map[int][]map[string]string { } } -func getAddressCodeTimelineOther() map[int][]map[string]string { +func getAddressCodeTimelineAdditional() map[int][]map[string]string { return map[int][]map[string]string{ // 行政区划代码(地址码)补充数据 110100: { diff --git a/generator.go b/generator.go index bb984c8..1359444 100644 --- a/generator.go +++ b/generator.go @@ -116,8 +116,8 @@ func generatorBirthdayCode(addressCode string, address string, birthday string) month := datePipeHandle(datePad(substr(birthday, 4, 6), "month"), "month") day := datePipeHandle(datePad(substr(birthday, 6, 8), "day"), "day") - if timeLine, ok := data.GetAddressCodeTimeline(cast.ToInt(addressCode)); ok { - for _, val := range timeLine { + if timeline, ok := data.GetAddressCodeTimeline(cast.ToInt(addressCode)); ok { + for _, val := range timeline { if val["address"] == address { if val["start_year"] != "" { startYear = val["start_year"]