Created
June 13, 2019 12:33
-
-
Save Heavyblade/30ce376ae40db0b01bdec16ff7c8b34a to your computer and use it in GitHub Desktop.
datatypes.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"C" | |
) | |
func main() { | |
} | |
//export EchoInt | |
func EchoInt(val int) int { | |
return val | |
} | |
//export EchoBool | |
func EchoBool(val bool) bool { | |
return val | |
} | |
//export EchoString | |
func EchoString(x *C.char) *C.char { | |
input := C.GoString(x) | |
return C.CString(input) | |
} | |
//export Echofloat | |
func Echofloat(x float64) float64 { | |
return x | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment