DiagnosticsError codes
M0001 syntax error
The file does not parse.
example $ marmot build . error[M0001]: expected operand, found '}' --> ./main.go:5:1 | 4 | x := 1 + | - this expression is not finished 5 | } | ^ expected an operand here error: build failed with 1 error for more about an error, run `marmot explain M0001`
The program that produced it
package main
func main() {
x := 1 +
}
The position is where the parser gave up, which is often just after the real mistake: look at the end of the previous line for a missing bracket, comma or operand.
The mistake and the fix
func main() {
x := 1 +
}func main() {
x := 1 + 2
_ = x
}The fix
Complete the expression or statement, or close the open bracket.
See also all error codes and marmot explain.