I think the question is about `go:embed` directive in `_test.go` files will be included in builds of non-test packages, right?
Don't know for sure, but I think: - a) if you have `mypkg_test.go` and in it `package mypkg_test` then `go:embed` will not get to your non test build as the package is different - b) if you have `mypkg_test.go` and in it `pakcage mypkg` then... less clear. As above referenced in original docs `_test.go` will be excluded from non test build regardless of package. My personal take, is to go:embed only in case a). Cheers, On Wednesday, June 2, 2021 at 8:09:20 AM UTC+8 peterGo wrote: > On Tuesday, June 1, 2021 at 9:17:11 AM UTC-4 manlio....@gmail.com wrote: > >> When a file is embedded in a test file, will the file be embedded only in >> the test binary? >> The documentation says nothing about this case, but the data from go list >> seems to confirm that the file is only embedded in the test binary. >> >> Thanks >> Manlio >> > > The documentation seems clear to me. > > Package testing > https://golang.org/pkg/testing/ > > To write a new test suite, create a file whose name ends _test.go that > contains the TestXxx functions as described here. Put the file in the same > package as the one being tested. The file will be excluded from regular > package builds but will be included when the "go test" command is run. > > Peter > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/de6c4d87-abf4-4ecc-bf99-63a5e24a1f8fn%40googlegroups.com.