DiagnosticsError codes
M0029 unknown struct field
A composite literal names a field the struct type does not have.
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
u := User{Nmae: "ada"}u := User{Name: "ada"} The fix
Use one of the struct's fields.
See also all error codes and marmot explain.
M0028 shadowed variable
A := in an inner block declares a new variable with the same name as one in an outer block.
M0100 vet finding
go vet's analyzers found code that compiles but is likely wrong: a Printf format that does not match its arguments, a copied lock, an unreachable statement, a struct tag that does not parse.