I have string
to struct
map in golang defined in the following way:
var Foo = map[string]struct{}{
"foo": struct{}{},
}
Gogland by default marks this declaration as warning, saying "Redundant type declaration".
var Foo = map[string]struct{}{
"foo": {},
}
Above code solves the warning, but I couldn't find any information about the difference between struct{}{}
and {}
declaration. Is it kind of a "short notation"?