honnef.co/go/tools@v0.5.0-0.dev.0.20240520180541-dcae280a5e87/stylecheck/st1011/testdata/src/example.com/CheckTimeNames/CheckTimeNames.go (about)

     1  // Package pkg ...
     2  package pkg
     3  
     4  import "time"
     5  
     6  type T1 struct {
     7  	aMS     int
     8  	B       time.Duration
     9  	BMillis time.Duration //@ diag(`don't use unit-specific suffix`)
    10  }
    11  
    12  func fn1(a, b, cMS time.Duration) { //@ diag(`don't use unit-specific suffix`)
    13  	var x time.Duration
    14  	var xMS time.Duration    //@ diag(`don't use unit-specific suffix`)
    15  	var y, yMS time.Duration //@ diag(`don't use unit-specific suffix`)
    16  	var zMS = time.Second    //@ diag(`don't use unit-specific suffix`)
    17  	aMS := time.Second       //@ diag(`don't use unit-specific suffix`)
    18  	unrelated, aMS := 0, 0
    19  	aMS, bMS := 0, time.Second //@ diag(re`var bMS .+ don't use unit-specific suffix`)
    20  
    21  	_, _, _, _, _, _, _, _ = x, xMS, y, yMS, zMS, aMS, unrelated, bMS
    22  }