README ¶ simple-c-code example A very simple example to show you how to write a c function in go. GitHub Webpage THE C CODE Here is a very simple c code example, int Add(int a, int b){ return a+b; IMPLEMENT WITH GO To implement using go use import "C", package main //int Add(int a, int b){ // return a+b; //} import "C" import "fmt" func main() { a := C.int(10) b := C.int(20) c := C.Add(a, b) fmt.Println(c) // 30 } RUN go run simple-c-code.go Expand ▾ Collapse ▴ Documentation ¶ There is no documentation for this package. Source Files ¶ View all Source files simple-c-code.go Click to show internal directories. Click to hide internal directories.