Skip to content

Commit

Permalink
fixes minor issues with linter
Browse files Browse the repository at this point in the history
  • Loading branch information
avarabyeu committed Mar 11, 2024
1 parent f6c98be commit 91d9953
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
uses: golangci/golangci-lint-action@v2
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.52.2
version: v1.56.0
# Optional: show only new issues if it's a pull request. The default value is `false`.
only-new-issues: true
# Run build of the application
Expand Down
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ linters:
- gci
- revive
- testableexamples
- depguard

#run:
# skip-dirs:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ help:
@echo "checkstyle - gofmt+golint+misspell"

init-deps:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.52.2
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s v1.56.0

#vendor:
# dep ensure --vendor-only
Expand All @@ -24,7 +24,7 @@ test:
$(GO) test -cover ${GODIRS_NOVENDOR}

lint:
bin/golangci-lint run --enable-all --deadline 10m ./...
bin/golangci-lint run --deadline 10m ./...

fmt:
gofumpt -extra -l -w ${GOFILES_NOVENDOR}
Expand Down
8 changes: 4 additions & 4 deletions internal/commands/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ import (

func TestUnderstandsYes(t *testing.T) {
t.Parallel()
assert.Equal(t, true, answerYes("yes"))
assert.True(t, answerYes("yes"))
}

func TestUnderstandsYesUpper(t *testing.T) {
t.Parallel()
assert.Equal(t, true, answerYes("YES"))
assert.True(t, answerYes("YES"))
}

func TestEmptyAnswer(t *testing.T) {
t.Parallel()
assert.Equal(t, false, answerYes(""))
assert.False(t, answerYes(""))
}

func TestUnderstandsNo(t *testing.T) {
t.Parallel()
assert.Equal(t, false, answerYes("no"))
assert.False(t, answerYes("no"))
}
5 changes: 3 additions & 2 deletions pkg/gorp/model_api_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"time"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

func TestUnixTimeDeserialization(t *testing.T) {
Expand All @@ -15,7 +16,7 @@ func TestUnixTimeDeserialization(t *testing.T) {

var unitTime Timestamp
err := json.Unmarshal([]byte(jsonStr), &unitTime)
assert.NoError(t, err)
require.NoError(t, err)

unitTime = Timestamp{unitTime.Truncate(1 * time.Minute)}

Expand All @@ -32,7 +33,7 @@ func TestUnixTimeSerialization(t *testing.T) {

d, _ := time.Parse(time.RFC3339, expTime)
bytes, err := json.Marshal(&Timestamp{d})
assert.NoError(t, err)
require.NoError(t, err)
assert.Equal(t, jsonStr, string(bytes))
}

Expand Down

0 comments on commit 91d9953

Please sign in to comment.