The analyzer has detected a parameter that has never been used in the body of a function or method.
The example:
func cardHasLock(width int, // <=
height int,
xScale float64,
yScale float64) {
lockWidth := int(math.Round(float64(height) * xScale))
lockHeight := int(math.Round(float64(height) * yScale))
....
}
The height parameter is used both when initializing the lockHeight variable and for lockWidth, which is a typo. To initialize the lockWidth variable correctly, use the width parameter:
lockWidth := int(math.Round(float64(width) * xScale))
The analyzer treats an unused parameter as acceptable and does not issue a warning in the following cases:
Was this page helpful?