summaryrefslogtreecommitdiff
path: root/Examples/test-suite/go/go_inout_runme.go
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-03-08 15:15:05 -0800
committerIan Lance Taylor <iant@golang.org>2022-03-08 15:15:05 -0800
commit70d530adfc4f4e0697179f6eb0b8a147a73d5889 (patch)
treecc6f897eff4ef3da25cf6e873bbda876002a5437 /Examples/test-suite/go/go_inout_runme.go
parent7ebe5cead32087ed6835a6e5715ac5cbf8c110f7 (diff)
downloadswig-70d530adfc4f4e0697179f6eb0b8a147a73d5889.tar.gz
swig -go: treat a nil argument as NULL
Let Go code pass "nil" when calling a C++ function that accepts a pointer to a class. The Go "nil" will be treated as a C++ "nullptr". Fixes #2203
Diffstat (limited to 'Examples/test-suite/go/go_inout_runme.go')
-rw-r--r--Examples/test-suite/go/go_inout_runme.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/Examples/test-suite/go/go_inout_runme.go b/Examples/test-suite/go/go_inout_runme.go
index 2dc5b9908..84dec7a0b 100644
--- a/Examples/test-suite/go/go_inout_runme.go
+++ b/Examples/test-suite/go/go_inout_runme.go
@@ -50,4 +50,8 @@ func main() {
fmt.Println("for c2.M got", pm, "want", want)
panic(pm)
}
+
+ c1 := go_inout.NewC1()
+ c2.M2(c1)
+ c2.M2(nil)
}