You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The follow is from GO programming lanugage spec:
//spec starts
Type declarations
...
// A Mutex is a data type with two methods Lock and Unlock.
type Mutex struct { /* Mutex fields */ }
func (m *Mutex) Lock() { /* Lock implementation */ }
func (m *Mutex) Unlock() { /* Unlock implementation */ }
// NewMutex has the same composition as Mutex but its method set is empty.
type NewMutex Mutex
// PrintableMutex's method set contains the methods
// Lock and Unlock bound to its anonymous field Mutex.
type PrintableMutex struct {
Mutex
}
//spec ends
I think the method set in anonymous field Mutex of PrintableMutex doesn't
have two methods: Lock and Unlock, only *Mutex does(the receiver is of *T).
So the comments of PrintableMutex are wrong. It should be *Mutex instead.
The text was updated successfully, but these errors were encountered:
by unix.sh:
The text was updated successfully, but these errors were encountered: