honnef.co/go/tools@v0.5.0-0.dev.0.20240520180541-dcae280a5e87/quickfix/qf1005/testdata/src/example.com/CheckMathPow/CheckMathPow.go (about)

     1  package pkg
     2  
     3  import "math"
     4  
     5  func fn() {
     6  	var x float64
     7  
     8  	_ = math.Pow(x, 0) //@ diag(`could expand call to math.Pow`)
     9  	_ = math.Pow(x, 1) //@ diag(`could expand call to math.Pow`)
    10  	_ = math.Pow(x, 2) //@ diag(`could expand call to math.Pow`)
    11  	_ = math.Pow(x, 3) //@ diag(`could expand call to math.Pow`)
    12  	_ = math.Pow(x, 6)
    13  
    14  	const a = 2
    15  	const b = 2.0
    16  	const c float64 = 2
    17  
    18  	_ = math.Pow(a, 2)     //@ diag(`could expand call to math.Pow`)
    19  	_ = math.Pow(b, 2)     //@ diag(`could expand call to math.Pow`)
    20  	_ = math.Pow(c, 2)     //@ diag(`could expand call to math.Pow`)
    21  	_ = math.Pow(a*1.0, 2) //@ diag(`could expand call to math.Pow`)
    22  
    23  	_ = math.Pow(x*2, 2) //@ diag(`could expand call to math.Pow`)
    24  	_ = math.Pow(x+2, 2) //@ diag(`could expand call to math.Pow`)
    25  
    26  	_ = math.Pow(x, x)
    27  	_ = math.Pow(x, -1)
    28  }