type fun struct {}
type starcraft struct {
*fun // embedding struct
mu sync.Mutex
}
I know I can literal initial struct startcraft as:
f := &fun{}
s := starcraft{f, *new(sync.Mutex)}
I don't like it, since:
a. I don't want to initialize sync.Mutex by myself
b. in this case there is a wasted copy using *new(sync.Mutex).
Is there any better way?