File tree Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Expand file tree Collapse file tree 3 files changed +28
-5
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ require (
1111 github.com/ashanbrown/makezero v0.0.0-20201205152432-7b7cdbb3025a
1212 github.com/bkielbasa/cyclop v1.2.0
1313 github.com/bombsimon/wsl/v3 v3.1.0
14- github.com/charithe/durationcheck v0.0.3
14+ github.com/charithe/durationcheck v0.0.4
1515 github.com/daixiang0/gci v0.2.8
1616 github.com/denis-tingajkin/go-header v0.4.2
1717 github.com/esimonov/ifshort v1.0.1
Original file line number Diff line number Diff line change 11//args: -Edurationcheck
22package testdata
33
4- import "time"
4+ import (
5+ "fmt"
6+ "time"
7+ )
58
6- func waitFor (someDuration time.Duration ) {
9+ type s struct {
10+ d int
11+ }
12+
13+ func durationcheckCase01 () {
14+ ss := s {10 }
15+ _ = time .Duration (ss .d ) * time .Second
16+ }
17+
18+ func durationcheckCase02 () {
19+ seconds := 10
20+ fmt .Print (time .Duration (seconds ) * time .Second )
21+ }
22+
23+ func durationcheckCase03 (someDuration time.Duration ) {
24+ timeToWait := someDuration * time .Second // ERROR "Multiplication of durations: `someDuration \\* time.Second` "
25+ time .Sleep (timeToWait )
26+ }
27+
28+ func durationcheckCase04 () {
29+ someDuration := 2 * time .Second
730 timeToWait := someDuration * time .Second // ERROR "Multiplication of durations: `someDuration \\* time.Second` "
831 time .Sleep (timeToWait )
932}
You can’t perform that action at this time.
0 commit comments