Skip to content

Commit

Permalink
Merge pull request #377 from invidian/updates
Browse files Browse the repository at this point in the history
Update golangci-lint to latest version v1.56.0
  • Loading branch information
invidian authored Feb 8, 2024
2 parents aa7afa7 + 6e46ef7 commit 5a13f2c
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
jobs:
build:
runs-on: ubuntu-latest
container: golangci/golangci-lint:v1.55.2
container: golangci/golangci-lint:v1.56.0
steps:
- uses: actions/cache@v2
with:
Expand Down
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ linters:
- godox
# Disabled until we implement some error types and migrate to use them.
- goerr113
# We don't really care about sprintf performance.
- perfsprint
# To allow defensive approach when initializing structs.
- ireturn
# Disabled until tests are split and moved to the right file names.
Expand Down Expand Up @@ -154,7 +156,6 @@ linters:
- nonamedreturns
- nosprintfhostport
- paralleltest
- perfsprint
- prealloc
- predeclared
- promlinter
Expand All @@ -163,6 +164,7 @@ linters:
- revive
- rowserrcheck
- sloglint
- spancheck
- sqlclosecheck
- stylecheck
- tagalign
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GORUN=$(GOCMD) run
GOBUILD=$(GOCMD) build -v -ldflags $(LD_FLAGS) -trimpath

CC_TEST_REPORTER_ID=6e107e510c5479f40b0ce9166a254f3f1ee0bc547b3e48281bada1a5a32bb56d
GOLANGCI_LINT_VERSION=v1.55.2
GOLANGCI_LINT_VERSION=v1.56.0
BIN_PATH=$$HOME/bin

GO_PACKAGES=./...
Expand Down
2 changes: 1 addition & 1 deletion pkg/etcd/member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ func TestValidate(t *testing.T) {
t.Parallel()

m := testCase.mutator(validMember(t))
err := m.Validate()

err := m.Validate()
if testCase.expectError && err == nil {
t.Fatalf("Expected error")
}
Expand Down
1 change: 1 addition & 0 deletions pkg/host/host_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ func TestValidate(t *testing.T) {
if testCase.Error && err == nil {
t.Fatalf(testCase.Message)
}

if !testCase.Error && err != nil {
t.Errorf(testCase.Message)
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/host/transport/ssh/ssh_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,6 @@ func TestNewBadSSHAgentEnv(t *testing.T) {
}
}

//nolint:paralleltest // This test may access SSHAuthSockEnv environment variable,
//nolint:paralleltest // which is a global variable, so to keep things stable, don't run it in parallel.
func TestNewSSHAgent(t *testing.T) {
agentKeyring := agent.NewKeyring()

Expand Down Expand Up @@ -729,8 +727,6 @@ func TestNewSSHAgent(t *testing.T) {
}
}

//nolint:paralleltest // This test may access SSHAuthSockEnv environment variable,
//nolint:paralleltest // which is a global variable, so to keep things stable, don't run it in parallel.
func TestNewSSHAgentWrongSocket(t *testing.T) {
addr := &net.UnixAddr{
Name: "@bar",
Expand Down
1 change: 0 additions & 1 deletion pkg/pki/privatekey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ aHR0cHM6Ly93d3cueW91dHViZS5jb20vd2F0Y2g/dj1kUXc0dzlXZ1hjUQo=
t.Parallel()

err := pki.ValidatePrivateKey(testCase.key)

if testCase.err && err == nil {
t.Fatalf("Expected error and didn't get any.")
}
Expand Down
1 change: 0 additions & 1 deletion pkg/types/certificate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func TestCertificateParse(t *testing.T) {
bar := &Foo{}

err := yaml.Unmarshal([]byte(testCase.YAML), bar)

if testCase.Error && err == nil {
t.Fatalf("Expected error and didn't get any.")
}
Expand Down
1 change: 0 additions & 1 deletion pkg/types/privatekey_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ func TestPrivateKeyParse(t *testing.T) {
bar := &Foo{}

err := yaml.Unmarshal([]byte(testCase.YAML), bar)

if testCase.Error && err == nil {
t.Fatalf("Expected error and didn't get any.")
}
Expand Down

0 comments on commit 5a13f2c

Please sign in to comment.