DiagnosticsError codes
M0013 no new variables
A short variable declaration (:=) must declare at least one new variable.
example $ marmot build . error[M0013]: no new variables on left side of := --> ./main.go:5:4 | 5 | x := 2 | ^^ no new variables on the left | help: use `=` instead of `:=` | 5 - x := 2 5 + x = 2 | error: build failed with 1 error 1 error can be fixed automatically: run `marmot fix` for more about an error, run `marmot explain M0013`
The program that produced it
package main
func main() {
x := 1
x := 2
_ = x
}
The mistake and the fix
x := 1
x := 2x := 1
x = 2The fix
Use = instead of :=.
See also all error codes and marmot explain.