Skip to content

Commit c6f56e6

Browse files
staticcheck: fix warnings in x/mongo/driver/dns
1 parent f938cd0 commit c6f56e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

x/mongo/driver/dns/dns.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -114,10 +114,10 @@ func validateSRVResult(recordFromSRV, inputHostName string) error {
114114
separatedInputDomain := strings.Split(strings.ToLower(inputHostName), ".")
115115
separatedRecord := strings.Split(strings.ToLower(recordFromSRV), ".")
116116
if l := len(separatedInputDomain); l < 3 && len(separatedRecord) <= l {
117-
return fmt.Errorf("Server record (%d levels) should have more domain levels than parent URI (%d levels)", l, len(separatedRecord))
117+
return fmt.Errorf("server record (%d levels) should have more domain levels than parent URI (%d levels)", l, len(separatedRecord))
118118
}
119119
if len(separatedRecord) < len(separatedInputDomain) {
120-
return errors.New("Domain suffix from SRV record not matched input domain")
120+
return errors.New("domain suffix from SRV record not matched input domain")
121121
}
122122

123123
inputDomainSuffix := separatedInputDomain
@@ -129,7 +129,7 @@ func validateSRVResult(recordFromSRV, inputHostName string) error {
129129
recordDomainSuffix := separatedRecord[domainSuffixOffset:]
130130
for ix, label := range inputDomainSuffix {
131131
if label != recordDomainSuffix[ix] {
132-
return errors.New("Domain suffix from SRV record not matched input domain")
132+
return errors.New("domain suffix from SRV record not matched input domain")
133133
}
134134
}
135135
return nil
@@ -145,11 +145,11 @@ func validateTXTResult(paramsFromTXT []string) error {
145145
for _, param := range paramsFromTXT {
146146
kv := strings.SplitN(param, "=", 2)
147147
if len(kv) != 2 {
148-
return errors.New("Invalid TXT record")
148+
return errors.New("invalid TXT record")
149149
}
150150
key := strings.ToLower(kv[0])
151151
if _, ok := allowedTXTOptions[key]; !ok {
152-
return fmt.Errorf("Cannot specify option '%s' in TXT record", kv[0])
152+
return fmt.Errorf("cannot specify option '%s' in TXT record", kv[0])
153153
}
154154
}
155155
return nil

0 commit comments

Comments
 (0)