Skip to Content
marmot
DiagnosticsError codes
example $ marmot build .
error[M0029]: unknown field Nmae in struct literal of type User
 --> ./main.go:6:12
  |
6 |     u := User{Nmae: "ada"}
  |               ^^^^ `User` has no field `Nmae`
  |
help: use `Name` (check it)
  |
6 -     u := User{Nmae: "ada"}
6 +     u := User{Name: "ada"}
  |

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

type User struct{ Name string }

func main() {
	u := User{Nmae: "ada"}
	_ = u
}

The mistake and the fix

The mistake
u := User{Nmae: "ada"}
Fixed
u := User{Name: "ada"} 

The fix

Use one of the struct's fields.

See also all error codes and marmot explain.

On this page

Was this page helpful?

Report an issueOpen issues