3 ms·
Because others might not be up with the terminology: in a Go struct an "embedded field" or "anonymous field" is a member of a struct that you didn't give a name
by LukeShu 11y ago
Because others might not be up with the terminology: in a Go struct an "embedded field" or "anonymous field" is a member of a struct that you didn't give a name to.
type MyType struct {
sync.Mutex // embedded/anonymous
mu sync.Mutex // not embedded
}
So AYBABTME's advice is to give the mutex a name.