1// Copyright 2022 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// An unexported method can be reachable from the plugin via interface 6// when a package is shared. So it need to be live. 7 8package main 9 10import ( 11 "plugin" 12 13 "testplugin/method3/p" 14) 15 16var i p.I 17 18func main() { 19 pl, err := plugin.Open("method3.so") 20 if err != nil { 21 panic(err) 22 } 23 24 f, err := pl.Lookup("F") 25 if err != nil { 26 panic(err) 27 } 28 29 f.(func())() 30 31 i = p.T(123) 32} 33