DiagnosticsError codes
M0009 wrong number of arguments
The call passes a different number of arguments than the function takes.
example $ marmot build . error[M0009]: too many arguments in call to pair --> ./main.go:7:7 | 3 | func pair() (int, int) | ---------------------- `pair` is declared here ... 7 | pair(1) | ^ unexpected argument | = note: expected `()`, found `(number)` error: build failed with 1 error for more about an error, run `marmot explain M0009`
The program that produced it
package main
func pair() (int, int)
func main() {
pair(1)
}
The mistake and the fix
func pair() (int, int)
pair(1)pair() The fix
Pass the arguments the signature lists.
See also all error codes and marmot explain.