Skip to content

Commit

Permalink
Backport of bootstrap: upgrade golangci-lint in prep for go1.20 into …
Browse files Browse the repository at this point in the history
…release/1.3.x (#16027)

* bootstrap: upgrade golangci-lint in prep for go1.20

This PR updates golangci-lint to work better with go1.20 - the previous
version would cause in oom on 'make check'.

(manual cherry-pick of ff4d9e8)

* test: add missing imports

* test: fixup imports

---------

Co-authored-by: Seth Hoenig <shoenig@duck.com>
  • Loading branch information
hc-github-team-nomad-core and shoenig authored Feb 2, 2023
1 parent 2c71f3a commit ebed7a0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ deps: ## Install build and development dependencies
lint-deps: ## Install linter dependencies
## Keep versions in sync with tools/go.mod (see https://github.com/golang/go/issues/30515)
@echo "==> Updating linter dependencies..."
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.48.0
go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.51.0
go install github.com/client9/misspell/cmd/misspell@v0.3.4
go install github.com/hashicorp/go-hclog/hclogvet@v0.1.5

Expand Down
1 change: 1 addition & 0 deletions command/agent/acl_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"github.com/hashicorp/nomad/ci"
"github.com/hashicorp/nomad/nomad/mock"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/shoenig/test/must"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
8 changes: 2 additions & 6 deletions e2e/e2eutil/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ func Register(jobID, jobFilePath string) error {
func RegisterWithArgs(jobID, jobFilePath string, args ...string) error {

baseArgs := []string{"job", "run", "-detach"}
for i := range args {
baseArgs = append(baseArgs, args[i])
}
baseArgs = append(baseArgs, args...)
baseArgs = append(baseArgs, "-")
ctx, cancel := context.WithTimeout(context.Background(), time.Second*10)
defer cancel()
Expand Down Expand Up @@ -224,9 +222,7 @@ func StopJob(jobID string, args ...string) error {
// Build our argument list in the correct order, ensuring the jobID is last
// and the Nomad subcommand are first.
baseArgs := []string{"job", "stop"}
for i := range args {
baseArgs = append(baseArgs, args[i])
}
baseArgs = append(baseArgs, args...)
baseArgs = append(baseArgs, jobID)

// Execute the command. We do not care about the stdout, only stderr.
Expand Down
2 changes: 2 additions & 0 deletions nomad/acl_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"fmt"
"io/ioutil"
"path/filepath"
"strings"
"testing"
"time"

Expand All @@ -13,6 +14,7 @@ import (
"github.com/hashicorp/nomad/nomad/mock"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/hashicorp/nomad/testutil"
"github.com/shoenig/test/must"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down
1 change: 1 addition & 0 deletions nomad/state/state_store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"github.com/hashicorp/nomad/nomad/mock"
"github.com/hashicorp/nomad/nomad/structs"
"github.com/kr/pretty"
"github.com/shoenig/test/must"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
Expand Down

0 comments on commit ebed7a0

Please sign in to comment.