Source file misc/cgo/testplugin/testdata/issue22175/plugin1.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  package main
     6  
     7  import "plugin"
     8  
     9  func F() int {
    10  	p2, err := plugin.Open("issue22175_plugin2.so")
    11  	if err != nil {
    12  		panic(err)
    13  	}
    14  	g, err := p2.Lookup("G")
    15  	if err != nil {
    16  		panic(err)
    17  	}
    18  	return g.(func() int)()
    19  }
    20  
    21  func main() {}
    22  

View as plain text