Skip to Content
marmot
DiagnosticsError codes
example $ marmot build .
error[M0008]: too many return values
 --> ./main.go:4:9
  |
3 | func main() {
  | ----------- `main` declares no results
4 |     return 1
  |            ^ returns a value
  |
  = note: expected `()`, found `(number)`

error: build failed with 1 error
for more about an error, run `marmot explain M0008`
The program that produced it
package main

func main() {
	return 1
}

The mistake and the fix

The mistake
func main() {
	return 1
}
Fixed
func f() int { 
	return 1
}

The fix

Return exactly the values in the signature, or change the signature.

See also all error codes and marmot explain.

On this page

Was this page helpful?

Report an issueOpen issues