2015-07-23 17:08:28 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
/*
|
2015-08-28 08:06:22 +00:00
|
|
|
#include <stdio.h>
|
2015-07-23 17:08:28 +00:00
|
|
|
char* foo(void) { return "hello, world!"; }
|
|
|
|
*/
|
|
|
|
import "C"
|
|
|
|
|
|
|
|
import "fmt"
|
2015-08-28 08:06:22 +00:00
|
|
|
import "runtime"
|
2015-07-23 17:08:28 +00:00
|
|
|
|
|
|
|
func main() {
|
2015-08-28 08:06:22 +00:00
|
|
|
runtime.GOMAXPROCS(runtime.NumCPU())
|
2015-07-23 17:08:28 +00:00
|
|
|
fmt.Println(C.GoString(C.foo()))
|
|
|
|
}
|