/trunk/Examples/test-suite/go/smart_pointer_simple_runme.go
# · Go · 19 lines · 15 code · 4 blank · 0 comment · 4 complexity · 699f93409aec1b97cd6fa1b589415a5f MD5 · raw file
- package main
- import . "./smart_pointer_simple"
- func main() {
- f := NewFoo()
- b := NewBar(f)
- b.SetX(3)
- if b.Getx() != 3 {
- panic(0)
- }
- fp := b.X__deref__()
- fp.SetX(4)
- if fp.Getx() != 4 {
- panic(0)
- }
- }