github.com/panjjo/go@v0.0.0-20161104043856-d62b31386338/misc/cgo/testshared/src/depBase/dep.go (about)

     1  package depBase
     2  
     3  import (
     4  	"os"
     5  	"reflect"
     6  )
     7  
     8  var V int = 1
     9  
    10  var HasMask []string = []string{"hi"}
    11  
    12  type HasProg struct {
    13  	array [1024]*byte
    14  }
    15  
    16  type Dep struct {
    17  	X int
    18  }
    19  
    20  func (d *Dep) Method() int {
    21  	// This code below causes various go.itab.* symbols to be generated in
    22  	// the shared library. Similar code in ../exe/exe.go results in
    23  	// exercising https://github.com/golang/go/issues/17594
    24  	reflect.TypeOf(os.Stdout).Elem()
    25  	return 10
    26  }
    27  
    28  func F() int {
    29  	defer func() {}()
    30  	return V
    31  }