By using Implement you can provide a definition of a function, taking the signature from a stub in the package. One major benefit of this approach is it makes it easy to handle external types in the function signature. Updates #55
17 lines
263 B
Go
17 lines
263 B
Go
// +build ignore
|
|
|
|
package main
|
|
|
|
import (
|
|
. "github.com/mmcloughlin/avo/build"
|
|
)
|
|
|
|
func main() {
|
|
Package("github.com/mmcloughlin/avo/examples/ext")
|
|
Implement("StructFieldB")
|
|
b := Load(Param("e").Field("B"), GP8())
|
|
Store(b, ReturnIndex(0))
|
|
RET()
|
|
Generate()
|
|
}
|