Skip to content

Commit

Permalink
Fix linter warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Youyuan Wu <youyuanwu@outlook.com>
  • Loading branch information
youyuanwu committed Feb 5, 2022
1 parent 7391b8a commit 5af39c3
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ linters:
- godot
- exhaustivestruct
- paralleltest
- varnamelen
- ireturn
#- thelper

issues:
Expand Down
1 change: 1 addition & 0 deletions date_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ func TestDate_Equal(t *testing.T) {
d2 := Date(time.Date(2020, 10, 11, 12, 13, 14, 15, time.UTC))
d3 := Date(time.Date(2020, 11, 12, 13, 14, 15, 16, time.UTC))

//nolint:gocritic
assert.True(t, d1.Equal(d1), "Same Date should Equal itself")
assert.True(t, d1.Equal(d2), "Date instances should be equal")
assert.False(t, d1.Equal(d3), "Date instances should not be equal")
Expand Down
1 change: 1 addition & 0 deletions format.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ type defaultFormats struct {

// NewFormats creates a new formats registry seeded with the values from the default
func NewFormats() Registry {
//nolint:forcetypeassert
return NewSeededFormats(Default.(*defaultFormats).data, nil)
}

Expand Down
1 change: 1 addition & 0 deletions time_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,7 @@ func TestDateTime_Equal(t *testing.T) {
dt1 := DateTime(time.Now())
dt2 := DateTime(time.Time(dt1).Add(time.Second))

//nolint:gocritic
assert.True(t, dt1.Equal(dt1), "DateTime instances should be equal")
assert.False(t, dt1.Equal(dt2), "DateTime instances should not be equal")
}
1 change: 1 addition & 0 deletions ulid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ func TestFormatULID_NewULID_and_Equal(t *testing.T) {
ulid2, err := NewULID()
assert.NoError(t, err)

//nolint:gocritic
assert.True(t, ulid1.Equal(ulid1), "ULID instances should be equal")
assert.False(t, ulid1.Equal(ulid2), "ULID instances should not be equal")

Expand Down

0 comments on commit 5af39c3

Please sign in to comment.