Skip to content

Instantly share code, notes, and snippets.

@yanolab
Created May 21, 2015
Embed
What would you like to do?
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