package mainimport ( "fmt" "runtime")type A struct { a int}func main() { self := new(A) self.a = 99 runtime.SetFinalizer(self, func(self *A) { self.a = 0 fmt.Println("des") })}