Closed github-actions[bot] closed 4 years ago
TIL, implement this
when using struct embedding to reference the outer struct from the inner struct. Saw it from tidb
type Gugu interface {
IsGezi()
}
type baseGugu struct {
self Gugu
}
func (b *baseGugu) bla() {
return b.self.bla() + 'base'
}
type Gaocegege struct{
baseGugu
}
func NewGaocegege() Gugu {
g := &Gaocegege{}
b := &baseGugu{self: g}
g.baseGugu = b
return g
}
while looking for OPT++ found https://lammps.sandia.gov/ which I have used during material science class ...
TIL type of go struct is Named
instead of Struct
, which is why Struct
in types package does not contains package and name for itself.
package gu
// the name cece and package gu is contained in Named, while Struct is Underlying
type Cece struct {
NotCai bool
}
Found more apache ....
联合周报第 167 期开始投稿 :tada: