Skip to content

Commit 3e06fff

Browse files
committed
review: right cgo test
1 parent b307fee commit 3e06fff

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/golinters/nilnesserr/testdata/nilnesserr_cgo.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,17 @@ package testdata
1010
}
1111
*/
1212
import "C"
13-
import "fmt"
13+
14+
import (
15+
"fmt"
16+
"unsafe"
17+
)
18+
19+
func _() {
20+
cs := C.CString("Hello from stdio\n")
21+
C.myprint(cs)
22+
C.free(unsafe.Pointer(cs))
23+
}
1424

1525
func do() error {
1626
return fmt.Errorf("do error")

0 commit comments

Comments
 (0)