Skip to content

Commit

Permalink
chore: make golangci-lint happy
Browse files Browse the repository at this point in the history
  • Loading branch information
fbreckle committed Nov 4, 2024
1 parent 1c0b05f commit 7228835
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion netbox/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (cfg *Config) Client() (*netboxclient.NetBoxAPI, error) {

trans.(*http.Transport).Proxy = http.ProxyFromEnvironment

if cfg.Headers != nil && len(cfg.Headers) > 0 {
if len(cfg.Headers) > 0 {
log.WithFields(log.Fields{
"custom_headers": cfg.Headers,
}).Debug("Setting custom headers on every request to Netbox")
Expand Down
6 changes: 3 additions & 3 deletions netbox/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,23 +25,23 @@ func init() {
desc += "."
}

if s.AtLeastOneOf != nil && len(s.AtLeastOneOf) > 0 {
if len(s.AtLeastOneOf) > 0 {
atLeastOneOf := make([]string, len(s.AtLeastOneOf))
for i, l := range s.AtLeastOneOf {
atLeastOneOf[i] = fmt.Sprintf("`%s`", l)
}
desc += fmt.Sprintf(" At least one of %s must be given.", joinStringWithFinalConjunction(atLeastOneOf, ", ", "or"))
}

if s.ExactlyOneOf != nil && len(s.ExactlyOneOf) > 0 {
if len(s.ExactlyOneOf) > 0 {
exactlyOneOf := make([]string, len(s.ExactlyOneOf))
for i, l := range s.ExactlyOneOf {
exactlyOneOf[i] = fmt.Sprintf("`%s`", l)
}
desc += fmt.Sprintf(" Exactly one of %s must be given.", joinStringWithFinalConjunction(exactlyOneOf, ", ", "or"))
}

if s.RequiredWith != nil && len(s.RequiredWith) > 0 {
if len(s.RequiredWith) > 0 {
requires := make([]string, len(s.RequiredWith))
for i, c := range s.RequiredWith {
requires[i] = fmt.Sprintf("`%s`", c)
Expand Down

0 comments on commit 7228835

Please sign in to comment.