diff --git a/.golangci.yml b/.golangci.yml index 450caef85..97696ca6d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,6 @@ issues: + max-issues-per-linter: 0 + max-same-issues: 0 exclude-rules: # Exclude funlen for testing files. - linters: @@ -26,4 +28,6 @@ linters: - depguard - tagalign run: - timeout: 5m \ No newline at end of file + timeout: 5m +output: + sort-results: true diff --git a/pkg/checkapp/commands.go b/pkg/checkapp/commands.go index fdb96e270..c70fd57c9 100644 --- a/pkg/checkapp/commands.go +++ b/pkg/checkapp/commands.go @@ -13,7 +13,7 @@ import ( func testCommand(ctx context.Context, input *Input) (string, int) { if len(input.Real.Commands) > input.Index { input.Real.Commands[input.Index].Run(&common.ActionInput{Type: website.EventGUI}) - return fmt.Sprintf("Command Triggered: %s", input.Real.Commands[input.Index].Name), http.StatusOK + return "Command Triggered: " + input.Real.Commands[input.Index].Name, http.StatusOK } else if len(input.Post.Commands) > input.Index { // check POST input for "new" command. input.Post.Commands[input.Index].Setup(input.Real.Logger, input.Real.Services.Website) @@ -36,5 +36,5 @@ func testCustomCommand(ctx context.Context, cmd *commands.Command) (string, int) return fmt.Sprintf("Command Failed! Error: %v", err), http.StatusInternalServerError } - return fmt.Sprintf("Command Successful! Output: %s", output), http.StatusOK + return "Command Successful! Output: " + output, http.StatusOK } diff --git a/pkg/client/cli.go b/pkg/client/cli.go index 36332f479..2adca0513 100644 --- a/pkg/client/cli.go +++ b/pkg/client/cli.go @@ -4,6 +4,7 @@ import ( "bufio" "bytes" "context" + "errors" "fmt" "io" "math/rand" @@ -27,7 +28,7 @@ const curlTimeout = 15 * time.Second // Errors. var ( - ErrInvalidHeader = fmt.Errorf("invalid header provided; must contain a colon") + ErrInvalidHeader = errors.New("invalid header provided; must contain a colon") ) // forceWriteWithExit is called only when a user passes --write or --reset on the command line. diff --git a/pkg/snapshot/snapshot.go b/pkg/snapshot/snapshot.go index 4c7e3bc35..508e3c66a 100644 --- a/pkg/snapshot/snapshot.go +++ b/pkg/snapshot/snapshot.go @@ -64,9 +64,9 @@ type Plugins struct { // Errors this package generates. var ( - ErrPlatformUnsup = fmt.Errorf("the requested metric is not available on this platform, " + + ErrPlatformUnsup = errors.New("the requested metric is not available on this platform, " + "if you know how to collect it, please open an issue on the github repo") - ErrNonZeroExit = fmt.Errorf("cmd exited non-zero") + ErrNonZeroExit = errors.New("cmd exited non-zero") ) // Snapshot is the output data sent to Notifiarr. diff --git a/pkg/triggers/fileupload/upload.go b/pkg/triggers/fileupload/upload.go index a893f975c..39e63bb50 100644 --- a/pkg/triggers/fileupload/upload.go +++ b/pkg/triggers/fileupload/upload.go @@ -2,6 +2,7 @@ package fileupload import ( "context" + "errors" "fmt" "os" "path/filepath" @@ -12,7 +13,7 @@ import ( const TrigUploadFile common.TriggerName = "File Upload" -var ErrInvalidFile = fmt.Errorf("invalid file provided") +var ErrInvalidFile = errors.New("invalid file provided") // Action contains the exported methods for this package. type Action struct {