Skip to content

Commit

Permalink
Fix lint errors/deprecated golangci opts
Browse files Browse the repository at this point in the history
  • Loading branch information
lkysow committed Mar 25, 2024
1 parent 453869d commit 492eb1c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 12 deletions.
7 changes: 2 additions & 5 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,14 @@ issues:
# Disable the default exclude list so that all excludes are explicitly
# defined in this file.
exclude-use-default: false

exclude-dirs-use-default: false

linters-settings:
govet:
check-shadowing: true
enable-all: true
disable:
- fieldalignment
- nilness
- shadow
- unusedwrite
forbidigo:
# Forbid the following identifiers (list of regexp).
Expand Down Expand Up @@ -88,5 +86,4 @@ linters-settings:

run:
timeout: 10m
concurrency: 4
skip-dirs-use-default: false
concurrency: 4
8 changes: 4 additions & 4 deletions cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,20 @@ func (cli *CLI) Run(args []string) int {

for {
select {
case err := <-runner.ErrCh:
case runnerErr := <-runner.ErrCh:
// Check if the runner's error returned a specific exit status, and
// return that value.
// If no value was given, return a generic exit status.
code := ExitCodeRunnerError
if typed, ok := err.(manager.ErrExitable); ok {
if typed, ok := runnerErr.(manager.ErrExitable); ok {
code = typed.ExitStatus()
}
switch code {
case 0:
log.Printf("[INFO] (cli) %s", err)
log.Printf("[INFO] (cli) %s", runnerErr)
return ExitCodeOK
default:
return logError(err, code)
return logError(runnerErr, code)
}
case <-runner.DoneCh:
return ExitCodeOK
Expand Down
7 changes: 4 additions & 3 deletions cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ import (
"testing"
"time"

gatedio "github.com/hashicorp/go-gatedio"

"github.com/hashicorp/consul-template/config"
"github.com/hashicorp/consul-template/signals"
"github.com/hashicorp/consul-template/test"
gatedio "github.com/hashicorp/go-gatedio"
)

func TestCLI_ParseFlags(t *testing.T) {
Expand Down Expand Up @@ -981,8 +982,8 @@ func TestCLI_Run(t *testing.T) {
t.Fatal(err)
}
defer os.Remove(f.Name())
if _, err := f.WriteString(`{{ key "once-foo" }}`); err != nil {
t.Fatal(err)
if _, writeErr := f.WriteString(`{{ key "once-foo" }}`); writeErr != nil {
t.Fatal(writeErr)
}

dest, err := os.CreateTemp("", "")
Expand Down

0 comments on commit 492eb1c

Please sign in to comment.