/trunk/Examples/test-suite/go/smart_pointer_multi_typedef_runme.go

# · Go · 20 lines · 16 code · 4 blank · 0 comment · 4 complexity · 339c14097504184e2af0168dd6ae7c74 MD5 · raw file

  1. package main
  2. import . "./smart_pointer_multi_typedef"
  3. func main() {
  4. f := NewFoo()
  5. b := NewBar(f)
  6. s := NewSpam(b)
  7. g := NewGrok(b)
  8. s.SetX(3)
  9. if s.Getx() != 3 {
  10. panic(0)
  11. }
  12. g.SetX(4)
  13. if g.Getx() != 4 {
  14. panic(0)
  15. }
  16. }