package main import "fmt" import "github.com/Satachito/sc1" func Dump( p interface{} ) { fmt.Printf( "%v:%T\n", p, p ) } func main() { Dump( sc1.EchoIntN( 8 ) ); Dump( sc1.EchoDoubleN( 9 ) ); } 実行 $ go run main1.go 8:int 9:float64 補足 もし nop.go ファイルを作るのが嫌だったら、sc1.swigcxx を別の名前(例えばsc1.i)に変えて、明示的に swig を呼び出してから go install すれば良い。 swig -go -c++ -cgo -intgosize 32 sc1.i go install sc1.go と sc1_wrap.cxx
![GO 1.5 と C++ を SWIG でブリッジさせる方法 - Qiita](https://cdn-ak-scissors.b.st-hatena.com/image/square/c308e73494b3cc7c62f0d3f8262111ab2a8a1e3a/height=288;version=1;width=512/https%3A%2F%2Fqiita-user-contents.imgix.net%2Fhttps%253A%252F%252Fcdn.qiita.com%252Fassets%252Fpublic%252Farticle-ogp-background-9f5428127621718a910c8b63951390ad.png%3Fixlib%3Drb-4.0.0%26w%3D1200%26mark64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTkxNiZoPTMzNiZ0eHQ9R08lMjAxLjUlMjAlRTMlODElQTglMjBDJTJCJTJCJTIwJUUzJTgyJTkyJTIwU1dJRyUyMCVFMyU4MSVBNyVFMyU4MyU5NiVFMyU4MyVBQSVFMyU4MyU4MyVFMyU4MiVCOCVFMyU4MSU5NSVFMyU4MSU5QiVFMyU4MiU4QiVFNiU5NiVCOSVFNiVCMyU5NSZ0eHQtY29sb3I9JTIzMjEyMTIxJnR4dC1mb250PUhpcmFnaW5vJTIwU2FucyUyMFc2JnR4dC1zaXplPTU2JnR4dC1jbGlwPWVsbGlwc2lzJnR4dC1hbGlnbj1sZWZ0JTJDdG9wJnM9ZDQwZDIzMTU3MGNiMzg5YzVjNGU2MGNlZTc1ZTE5YzU%26mark-x%3D142%26mark-y%3D112%26blend64%3DaHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTYxNiZ0eHQ9JTQwU2F0YWNoaXRvJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9MzYmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz1mMjY2NjdlZWRmOGNjMGUzMWExYjg2N2I3YmEyMGVkNA%26blend-x%3D142%26blend-y%3D491%26blend-mode%3Dnormal%26s%3Da1bf893a98bd0939732090c13b6db9cd)