DiagnosticsError codes
M0012 assignment count mismatch
The number of variables on the left does not match the number of values on the right.
example $ marmot build . error[M0012]: assignment mismatch: 1 variable but strconv.Atoi returns 2 values --> ./main.go:6:7 | 6 | n := strconv.Atoi("42") | ^^^^^^^^^^^^ `strconv.Atoi` returns 2 values | = help: receive every result: `n, err := strconv.Atoi("42")` error: build failed with 1 error for more about an error, run `marmot explain M0012`
The program that produced it
package main
import "strconv"
func main() {
n := strconv.Atoi("42")
_ = n
}
The mistake and the fix
n := strconv.Atoi(s)n, err := strconv.Atoi(s)
if err != nil {
return err
} The fix
Receive every result, using _ for the ones you do not need.
See also all error codes and marmot explain.