github.com/shijuvar/go@v0.0.0-20141209052335-e8f13700b70c/misc/cgo/testso/cgoso.go (about) 1 // Copyright 2011 The Go Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style 3 // license that can be found in the LICENSE file. 4 5 package cgosotest 6 7 /* 8 // intentionally write the same LDFLAGS differently 9 // to test correct handling of LDFLAGS. 10 #cgo linux LDFLAGS: -L. -lcgosotest 11 #cgo dragonfly LDFLAGS: -L. -l cgosotest 12 #cgo freebsd LDFLAGS: -L. -l cgosotest 13 #cgo openbsd LDFLAGS: -L. -l cgosotest 14 #cgo netbsd LDFLAGS: -L. libcgosotest.so 15 #cgo darwin LDFLAGS: -L. libcgosotest.dylib 16 #cgo windows LDFLAGS: -L. libcgosotest.dll 17 18 void init(void); 19 void sofunc(void); 20 */ 21 import "C" 22 23 func Test() { 24 C.init() 25 C.sofunc() 26 } 27 28 //export goCallback 29 func goCallback() { 30 }