struct { int } is a struct with an anonymous field of type int .

struct { int int } is a struct with a field named int of type int .

int is not a keyword; it can be used as an identifier.

The struct types are not identical; the corresponding fields do not have the same names.

A field declared with a type but no explicit field name is an anonymous field and the unqualified type name acts as the anonymous field name. Therefore, field names a.int and b.int are valid. For example,

a := struct{ int }{1} b := struct{ int int }{1} a.int = 2 b.int = a.int