Skip to content

Commit

Permalink
fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
kuritka committed Nov 5, 2024
1 parent 8523e12 commit 001133a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions cmd/webhook/init/dnsprovider/dnsprovider.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ func Init(config configuration.Config) (provider.Provider, error) {
regexp.MustCompile(config.RegexDomainExclusion),
)
} else {
if config.DomainFilter != nil && len(config.DomainFilter) > 0 {
if len(config.DomainFilter) > 0 {
createMsg += fmt.Sprintf("domain filter: '%s', ", strings.Join(config.DomainFilter, ","))
}
if config.ExcludeDomains != nil && len(config.ExcludeDomains) > 0 {
if len(config.ExcludeDomains) > 0 {
createMsg += fmt.Sprintf("exclude domain filter: '%s', ", strings.Join(config.ExcludeDomains, ","))
}
domainFilter = endpoint.NewDomainFilterWithExclusions(config.DomainFilter, config.ExcludeDomains)
Expand Down
3 changes: 2 additions & 1 deletion pkg/webhook/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Generated by GoLic, for more details see: https://github.com/AbsaOSS/golic

import (
"encoding/json"
"errors"
"fmt"
"net/http"

Expand Down Expand Up @@ -89,7 +90,7 @@ func (p *Webhook) headerCheck(isContentType bool, w http.ResponseWriter, r *http
} else {
msg += "an accept header"
}
err := fmt.Errorf(msg)
err := errors.New(msg)

_, writeErr := fmt.Fprint(w, err.Error())
if writeErr != nil {
Expand Down

0 comments on commit 001133a

Please sign in to comment.