Skip to content

Commit

Permalink
Fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
zc-devs committed Jul 15, 2023
1 parent b4cd86b commit c0c6ddc
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cmd/coraza-spoa/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (

func main() {
cfg := flag.String("config", "", "configuration file")
//nolint:staticcheck // That's exactly nil check
if cfg == nil {
log.Fatal().Msg("configuration file is not set")
}
Expand All @@ -22,6 +23,7 @@ func main() {

log.SetDebug(*debug)

//nolint:staticcheck // Nil is checked above
if err := config.InitConfig(*cfg); err != nil {
log.Fatal().Err(err).Msg("Can't initialize configuration")
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/criteo/haproxy-spoe-go v1.0.6
github.com/magefile/mage v1.15.0
github.com/rs/zerolog v1.29.1
github.com/sirupsen/logrus v1.9.3
gopkg.in/yaml.v3 v3.0.1
)

Expand All @@ -17,7 +18,6 @@ require (
github.com/mattn/go-isatty v0.0.14 // indirect
github.com/petar-dambovaliev/aho-corasick v0.0.0-20211021192214-5ab2d9280aa9 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sirupsen/logrus v1.9.3 // indirect
github.com/stretchr/testify v1.8.0 // indirect
github.com/tidwall/gjson v1.14.4 // indirect
github.com/tidwall/match v1.1.1 // indirect
Expand Down
6 changes: 2 additions & 4 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ var WafErrorCallback = func(mr types.MatchedRule) {
}

// InitLogging initializes the logging.
func InitLogging(file, level, spoeLevel string) error {
func InitLogging(file, level, spoeLevel string) {
if level == "" && file == "" {
Debug().Msg("Nothing to configure, using standard logger")
return nil
return
}

logger := Logger
Expand Down Expand Up @@ -60,8 +60,6 @@ func InitLogging(file, level, spoeLevel string) error {
Debug().Msgf("Setting up %v SPOE log level", targetSpoeLevel)
spoelog.SetLevel(targetSpoeLevel)
}

return nil
}

func SetDebug(debug bool) {
Expand Down

0 comments on commit c0c6ddc

Please sign in to comment.