> In go, you have to assign the error, and if you assign it you have to use the variable.
Nope. Go errors on dead variables, not on dead stores.
And because idiomatic go tends to reassign errors to the same variable if you have multiple error-returning functions in the same scope any one of them being checked will make the compiler happy.
You also do not have to assign the error at all, you can just ignore the entire thing.