IP库查询结果显示城市

This commit is contained in:
刘祥超
2021-08-15 20:08:04 +08:00
parent fed725d45c
commit 580d09ef99

View File

@@ -22,7 +22,7 @@ func (this *Result) Summary() string {
if len(this.Province) > 0 && !lists.ContainsString(pieces, this.Province) {
pieces = append(pieces, this.Province)
}
if len(this.City) > 0 && !lists.ContainsString(pieces, this.City) && !lists.ContainsString(pieces, strings.TrimSuffix(this.Province, "市")) {
if len(this.City) > 0 && !lists.ContainsString(pieces, this.City) && !lists.ContainsString(pieces, strings.TrimSuffix(this.City, "市")) {
pieces = append(pieces, this.City)
}
return strings.Join(pieces, " ")