Skip to content

Commit 225afb4

Browse files
committed
Format and fix some linter issues
1 parent c3b7956 commit 225afb4

File tree

4 files changed

+571
-572
lines changed

4 files changed

+571
-572
lines changed

address.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ type Address struct {
2020
func (a *Address) FormattedParts() []string {
2121
rule, found := formatRules[strings.ToUpper(a.Country)]
2222
if !found {
23-
rule, _ = formatRules["DE"]
23+
rule = formatRules["DE"]
2424
}
2525
return a.formatWithRule(rule)
2626
}
@@ -36,14 +36,14 @@ func (a *Address) formatWithRule(r []string) []string {
3636
s = strings.Replace(s, "{PostalCode}", a.PostalCode, -1)
3737
s = strings.Replace(s, "{Locality}", a.Locality, -1)
3838
s = strings.Replace(s, "{Region}", a.Region, -1)
39-
if strings.Index(s, "{-Region}") >= 0 {
39+
if strings.Contains(s, "{-Region}") {
4040
if a.Region != "" {
4141
s = strings.Replace(s, "{-Region}", "-"+a.Region, -1)
4242
} else {
4343
s = strings.Replace(s, "{-Region}", "", -1)
4444
}
4545
}
46-
if strings.Index(s, "{, Region}") >= 0 {
46+
if strings.Contains(s, "{, Region}") {
4747
if a.Region != "" {
4848
s = strings.Replace(s, "{, Region}", ", "+a.Region, -1)
4949
} else {

0 commit comments

Comments
 (0)