Skip to content

Commit

Permalink
Add durationcheck lint (spiffe#2289)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcos Yacob <[email protected]>
  • Loading branch information
MarcosDY authored May 17, 2021
1 parent 6e6ee95 commit 1878d29
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ linters:
enable:
- bodyclose
- depguard
- durationcheck
- errorlint
- goimports
- golint
Expand Down
6 changes: 3 additions & 3 deletions pkg/agent/common/backoff/backoff_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ func TestBackOff(t *testing.T) {
mockClk := clock.NewMock(t)
b := NewBackoff(mockClk, testInitialInterval)

var expectedResults = []time.Duration{6400, 9600, 14400, 21600, 32400, 48600, 72900, 109350, 153600, 153600}
for i, d := range expectedResults {
expectedResults[i] = d * time.Millisecond
expectedResults := []time.Duration{}
for _, d := range []int{6400, 9600, 14400, 21600, 32400, 48600, 72900, 109350, 153600, 153600} {
expectedResults = append(expectedResults, time.Duration(d)*time.Millisecond)
}

for _, expected := range expectedResults {
Expand Down

0 comments on commit 1878d29

Please sign in to comment.