Skip to content

Commit

Permalink
Merge branch 'dn2_bindata' into unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
davidnewhall committed Jul 21, 2024
2 parents 808ba84 + 27adcdf commit 8a162e9
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
6 changes: 5 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
issues:
max-issues-per-linter: 0
max-same-issues: 0
exclude-rules:
# Exclude funlen for testing files.
- linters:
Expand Down Expand Up @@ -26,4 +28,6 @@ linters:
- depguard
- tagalign
run:
timeout: 5m
timeout: 5m
output:
sort-results: true
4 changes: 2 additions & 2 deletions pkg/checkapp/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
}
3 changes: 2 additions & 1 deletion pkg/client/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"bufio"
"bytes"
"context"
"errors"
"fmt"
"io"
"math/rand"
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions pkg/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 2 additions & 1 deletion pkg/triggers/fileupload/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package fileupload

import (
"context"
"errors"
"fmt"
"os"
"path/filepath"
Expand All @@ -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 {
Expand Down

0 comments on commit 8a162e9

Please sign in to comment.