Skip to content

Commit

Permalink
Merge pull request #7 from szuecs/build/add-linters
Browse files Browse the repository at this point in the history
add linters go vet and staticcheck
  • Loading branch information
rueian authored May 8, 2024
2 parents 055c177 + 0afe1a3 commit 92698e9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
13 changes: 13 additions & 0 deletions dockertest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,19 @@

set -ev

go vet ./...

go install honnef.co/go/tools/cmd/staticcheck@latest
# disabled checks
# -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
Expand Down
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 92698e9

Please sign in to comment.