dyweb / weekly

DevComm-Shanghai Weekly 上海地区高校技术社团联合周报(欢迎投稿)
https://dyweb-weekly.netlify.com/
65 stars 5 forks source link

Weekly-167 #200

Closed github-actions[bot] closed 4 years ago

github-actions[bot] commented 4 years ago

联合周报第 167 期开始投稿 :tada:

at15 commented 4 years ago

Go garbage collection

at15 commented 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
}
at15 commented 4 years ago

while looking for OPT++ found https://lammps.sandia.gov/ which I have used during material science class ...

at15 commented 4 years ago

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
}
at15 commented 4 years ago

Found more apache ....