mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 20:52:22 +00:00
26 lines
395 B
Go
26 lines
395 B
Go
// Copyright © 2017 ChaiShushan <chaishushan{AT}gmail.com>.
|
|
// License: https://creativecommons.org/licenses/by-nc-sa/4.0/
|
|
|
|
package main
|
|
|
|
import "C"
|
|
|
|
func main() {
|
|
helloString("hello") // _GoString_
|
|
}
|
|
|
|
//export helloInt
|
|
func helloInt(s int) {
|
|
println(s)
|
|
}
|
|
|
|
//export helloString
|
|
func helloString(s string) {
|
|
println(s)
|
|
}
|
|
|
|
//export helloSlice
|
|
func helloSlice(s []byte) {
|
|
println(string(s))
|
|
}
|