Skip to content

Commit

Permalink
chore: golangci-lint 1.61.0 (#2787)
Browse files Browse the repository at this point in the history
* chore: golangci-lint 1.61.0

Update golangci-lint to v1.61.0 and update the action to v6.1.0.

* Update ci-test-go.yml

Co-authored-by: Manuel de la Peña <[email protected]>

* fix: lint

* chore: fix not empty check

Fix use of assert.NotEmpty and replace assert with replace.

---------

Co-authored-by: Manuel de la Peña <[email protected]>
  • Loading branch information
stevenh and mdelapenya authored Sep 20, 2024
1 parent fa560fb commit fca9698
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-test-go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,10 @@ jobs:

- name: golangci-lint
if: ${{ inputs.platform == 'ubuntu-latest' }}
uses: golangci/golangci-lint-action@9d1e0624a798bb64f6c3cea93db47765312263dc # v5
uses: golangci/golangci-lint-action@aaa42aa0628b4ae2578232a66b541047968fac86 # v6.1.0
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.59.1
version: v1.61.0
# Optional: working directory, useful for monorepos
working-directory: ${{ inputs.project-directory }}
# Optional: golangci-lint command line arguments.
Expand Down
2 changes: 1 addition & 1 deletion commons-test.mk
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ define go_install
endef

$(GOBIN)/golangci-lint:
$(call go_install,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1)
$(call go_install,github.com/golangci/golangci-lint/cmd/golangci-lint@v1.61.0)

$(GOBIN)/gotestsum:
$(call go_install,gotest.tools/gotestsum@latest)
Expand Down
2 changes: 1 addition & 1 deletion container.go
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ func (c *ContainerRequest) validateMounts() error {

c.HostConfigModifier(&hostConfig)

if hostConfig.Binds != nil && len(hostConfig.Binds) > 0 {
if len(hostConfig.Binds) > 0 {
for _, bind := range hostConfig.Binds {
parts := strings.Split(bind, ":")
if len(parts) != 2 {
Expand Down
3 changes: 1 addition & 2 deletions internal/config/config_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package config

import (
"fmt"
"os"
"path/filepath"
"testing"
Expand Down Expand Up @@ -517,7 +516,7 @@ func TestReadTCConfig(t *testing.T) {
},
}
for _, tt := range tests {
t.Run(fmt.Sprintf(tt.name), func(t *testing.T) {
t.Run(tt.name, func(t *testing.T) {
tmpDir := t.TempDir()
t.Setenv("HOME", tmpDir)
t.Setenv("USERPROFILE", tmpDir) // Windows support
Expand Down
5 changes: 2 additions & 3 deletions modules/consul/consul_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"testing"

capi "github.com/hashicorp/consul/api"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/testcontainers/testcontainers-go"
Expand Down Expand Up @@ -47,11 +46,11 @@ func TestConsul(t *testing.T) {
// Check if API is up
host, err := ctr.ApiEndpoint(ctx)
require.NoError(t, err)
assert.NotEmpty(t, len(host))
require.NotEmpty(t, host)

res, err := http.Get("http://" + host)
require.NoError(t, err)
assert.Equal(t, http.StatusOK, res.StatusCode)
require.Equal(t, http.StatusOK, res.StatusCode)

cfg := capi.DefaultConfig()
cfg.Address = host
Expand Down

0 comments on commit fca9698

Please sign in to comment.