Whose Error Is It?

Go printed this

declared and not used: x
What it meansThe Go compiler refuses to build because the local variable x is declared but its value is never read anywhere in the function.
The first thing to checkRemove the variable if it is leftover, actually use it, or assign it to the blank identifier with _ = x temporarily while you are still debugging.
The walrus saysGo would rather not compile than let a variable sit idle.

More from Go

All 75 errors

Whose Error Is It? · Status Menu · Back to the bar