atc0005 / go-nagios

Shared Golang package for Nagios plugins
MIT License
8 stars 3 forks source link

`err113` linting issues: `do not define dynamic errors, use wrapped static errors instead` #121

Closed atc0005 closed 2 years ago

atc0005 commented 2 years ago

From a recent workflow run of the unstable go-ci container:

nagios.go:143:10: err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"provided performance data missing required label\")" (goerr113)
        return fmt.Errorf("provided performance data missing required label")
               ^
nagios.go:145:10: err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"provided performance data missing required value\")" (goerr113)
        return fmt.Errorf("provided performance data missing required value")
               ^
nagios.go:255:18 err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"plugin crash/panic detected: %s\", err)" (goerr113)
        es.LastError = fmt.Errorf("plugin crash/panic detected: %s", err)
                       ^
nagios.go:460:10: err113: do not define dynamic errors, use wrapped static errors instead: "fmt.Errorf(\"no performance data provided\")" (goerr113)
        return fmt.Errorf("no performance data provided")
               ^