Logo
Explore Help
Register Sign In
code/avo
1
0
Fork 0
You've already forked avo
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
main
avo/examples/ext/ext_test.go

18 lines
314 B
Go
Raw Permalink Normal View History

gotypes,build: add Implement (#58) 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
2019-01-22 22:35:01 -08:00
package ext
import (
"testing"
"testing/quick"
update
2026-03-06 20:14:02 +00:00
"sources.truenas.cloud/code/avo/examples/ext/ext"
gotypes,build: add Implement (#58) 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
2019-01-22 22:35:01 -08:00
)
//go:generate go run asm.go -out ext.s
func TestFunc(t *testing.T) {
expect := func(e ext.Struct) byte { return e.B }
if err := quick.CheckEqual(StructFieldB, expect, nil); err != nil {
t.Fatal(err)
}
}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.4 Page: 172ms Template: 11ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API