Lucky hour! Grab a free trial license — offer ends in 00:59:58. Claim now
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?
Your message has been sent. We will email you at
If you do not see the email in your inbox, please check if it is filtered to one of the following folders: