Skip to content

Commit

Permalink
add linters go vet and staticcheck
Browse files Browse the repository at this point in the history
fix: staticcheck S1021
fix: #6

Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs committed May 7, 2024
1 parent 055c177 commit 6fc3a0f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
15 changes: 15 additions & 0 deletions dockertest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,23 @@

set -ev

go vet ./...

go install honnef.co/go/tools/cmd/staticcheck@latest
# disabled checks
# -S1021
# -ST1000 missing package doc in internal packages
# -ST1003 wrong naming convention would require breaking changes
# -ST1012 wrong error name convention in om package would require breaking changes
# -ST1016 violation of methods on the same type should have the same receiver name in valkeyhook
# -ST1020 violation of go doc comment on exported methods in valkeycompat
# -ST1021 violation of go doc comment on exported types in valkeycompat
# -U1000 unused check in mock package
staticcheck -checks "all,-ST1000,-ST1003,-ST1012,-ST1016,-ST1020,-ST1021,-U1000" ./... | (grep -v "_test.go:" && exit 1 || exit 0)

trap "docker-compose down -v" EXIT
docker-compose up -d
sleep 5

go install gotest.tools/[email protected]
gotestsum --format standard-verbose --junitfile unit-tests.xml -- -coverprofile=coverage.out -race -timeout 30m "$@"
3 changes: 1 addition & 2 deletions valkeycompat/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -707,8 +707,7 @@ func (c *Compat) Keys(ctx context.Context, pattern string) *StringSliceCmd {
}

func (c *Compat) Migrate(ctx context.Context, host string, port int64, key string, db int64, timeout time.Duration) *StatusCmd {
var cmd valkey.Completed
cmd = c.client.B().Migrate().Host(host).Port(port).Key(key).DestinationDb(db).Timeout(formatSec(timeout)).Build()
cmd := c.client.B().Migrate().Host(host).Port(port).Key(key).DestinationDb(db).Timeout(formatSec(timeout)).Build()
resp := c.client.Do(ctx, cmd)
return newStatusCmd(resp)
}
Expand Down

0 comments on commit 6fc3a0f

Please sign in to comment.