github.com/zebozhuang/go@v0.0.0-20200207033046-f8a98f6f5c5d/misc/cgo/testplugin/src/sub/plugin1/plugin1.go (about)

     1  // Copyright 2016 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  package main
     6  
     7  // // No C code required.
     8  import "C"
     9  
    10  import "common"
    11  
    12  func F() int { return 17 }
    13  
    14  var FuncVar = func() {}
    15  
    16  func ReadCommonX() int {
    17  	FuncVar()
    18  	return common.X
    19  }
    20  
    21  func main() {
    22  	panic("plugin1.main called")
    23  }