GoPLS Viewer

Home|gopls/go/analysis/passes/cgocall/testdata/src/b/b.go
1// Copyright 2017 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// Test the cgo checker on a file that doesn't use cgo, but has an
6// import named "C".
7
8package b
9
10import C "fmt"
11
12import "unsafe"
13
14func init() {
15    var f func()
16    C.Println(unsafe.Pointer(&f))
17
18    // Passing a pointer (via a slice), but C is fmt, not cgo.
19    C.Println([]int{3})
20}
21
MembersX
C
unsafe
init
Members
X