CHORE: Remediate staticcheck warnings (#3231)

This commit is contained in:
Tom Limoncelli 2024-12-09 17:07:43 -05:00 committed by GitHub
parent 52f62421c5
commit 9357743ee9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 4 deletions

View file

@ -17,6 +17,7 @@ func hashFunc(call otto.FunctionCall) otto.Value {
} }
algorithm := call.Argument(0).String() // The algorithm to use for hashing algorithm := call.Argument(0).String() // The algorithm to use for hashing
value := call.Argument(1).String() // The value to hash value := call.Argument(1).String() // The value to hash
//lint:ignore SA4006 work around bug in staticcheck. This value is needed if the switch statement follows the default path.
result := otto.Value{} result := otto.Value{}
fmt.Printf("%s\n", value) fmt.Printf("%s\n", value)

View file

@ -98,7 +98,7 @@ func (api *autoDNSProvider) GetZoneRecordsCorrections(dc *models.DomainConfig, e
err := api.updateZone(domain, resourceRecords, nameServers, zoneTTL) err := api.updateZone(domain, resourceRecords, nameServers, zoneTTL)
if err != nil { if err != nil {
return fmt.Errorf(err.Error()) return fmt.Errorf("%s", err.Error())
} }
return nil return nil

View file

@ -729,7 +729,7 @@ func compileAttributeErrors(err *dnsimpleapi.ErrorResponse) error {
e := strings.Join(errors, "& ") e := strings.Join(errors, "& ")
message += fmt.Sprintf(": %s %s", field, e) message += fmt.Sprintf(": %s %s", field, e)
} }
return fmt.Errorf(message) return fmt.Errorf("%s", message)
} }
// Return true if the string ends in one of DNSimple's name server domains // Return true if the string ends in one of DNSimple's name server domains

View file

@ -690,7 +690,7 @@ func (c *hednsProvider) parseResponseForDocumentAndErrors(response *http.Respons
return true return true
} }
} }
err = fmt.Errorf(element.Text()) err = fmt.Errorf("%s", element.Text())
return false return false
}) })

View file

@ -177,7 +177,7 @@ func (o *oracleProvider) GetNameservers(domain string) ([]*models.Nameserver, er
if err != nil { if err != nil {
nssStrip, err := models.ToNameserversStripTD(nss) nssStrip, err := models.ToNameserversStripTD(nss)
if err != nil { if err != nil {
return nil, fmt.Errorf("Could not determine if trailing dots should be stripped or not...") return nil, fmt.Errorf("could not determine if trailing dots should be stripped or not")
} }
return nssStrip, nil return nssStrip, nil