Skip to content

Instantly share code, notes, and snippets.

@yanolab
Created May 21, 2015 00:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yanolab/ec684dce297139e6b06e to your computer and use it in GitHub Desktop.
Save yanolab/ec684dce297139e6b06e to your computer and use it in GitHub Desktop.
sample of shared library for go1.5(cgo)
package main
import (
"C"
"log"
)
//export fib
func fib(n int) int {
if (n < 2) { return n }
return fib(n - 2) + fib(n - 1)
}
func init() {
log.Println("Loaded!!")
}
func main() {
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment