whatcanGOwrong
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
package main
|
||||
|
||||
/*
|
||||
#include <stdio.h>
|
||||
char* foo(void) { return "hello, world!"; }
|
||||
*/
|
||||
import "C"
|
||||
|
||||
import "fmt"
|
||||
import "runtime"
|
||||
|
||||
func main() {
|
||||
runtime.GOMAXPROCS(runtime.NumCPU())
|
||||
fmt.Println(C.GoString(C.foo()))
|
||||
}
|
||||
Reference in New Issue
Block a user