github.com/panjjo/go@v0.0.0-20161104043856-d62b31386338/misc/cgo/testplugin/src/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 3 }
    13  
    14  func ReadCommonX() int {
    15  	return common.X
    16  }
    17  
    18  var Seven int
    19  
    20  func init() {
    21  	Seven = 7
    22  	common.X *= Seven
    23  }
    24  
    25  func main() {
    26  	panic("plugin1.main called")
    27  }