github.com/serversong/goreporter@v0.0.0-20200325104552-3cfaf44fd178/linters/staticcheck/testdata/CheckTimeSleepConstant.go (about)

     1  package pkg
     2  
     3  import "time"
     4  
     5  const c1 = 1
     6  const c2 = 200
     7  
     8  func fn() {
     9  	time.Sleep(1)  // MATCH /sleeping for 1/
    10  	time.Sleep(42) // MATCH /sleeping for 42/
    11  	time.Sleep(201)
    12  	time.Sleep(c1)
    13  	time.Sleep(c2)
    14  	time.Sleep(2 * time.Nanosecond)
    15  	time.Sleep(time.Nanosecond)
    16  }