1
0
mirror of https://github.com/golang/go synced 2024-11-19 07:54:43 -07:00
go/internal/lsp/testdata/cgo/declarecgo.go

27 lines
374 B
Go
Raw Normal View History

package cgo
/*
#include <stdio.h>
#include <stdlib.h>
void myprint(char* s) {
printf("%s\n", s);
}
*/
import "C"
import "fmt"
import "unsafe"
func Example() { //@mark(funccgoexample, "Example"),item(funccgoexample, "Example", "func()", "func")
fmt.Println()
cs := C.CString("Hello from stdio\n")
C.myprint(cs)
C.free(unsafe.Pointer(cs))
}
func _() {
Example()
}