Skip to Content
marmot
DiagnosticsError codes
example $ marmot build .
error[M0016]: invalid operation: m < n (operator < not defined on map)
 --> ./main.go:5:6
  |
5 |     _ = m < n // maps have no order
  |         ^

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

func main() {
	var m, n map[string]int
	_ = m < n // maps have no order
}

The mistake and the fix

The mistake
var m, n map[string]int
_ = m < n // maps have no order
Fixed
_ = len(m) < len(n) 

See also all error codes and marmot explain.

On this page

Was this page helpful?

Report an issueOpen issues