On Fri, Jun 28, 2024 at 3:25 PM Victor Manuel “Vitu” Giordano <vitucho3...@gmail.com> wrote: > > I struggle with performing all the tests written in a file that requires > symbols defined on other files of the same package. > > For example > $ go test practice_resource_test.go > # command-line-arguments [command-line-arguments.test] > ./practice_resource_test.go:11:12: undefined: PracticeResource > ./practice_resource_test.go:12:12: undefined: PracticeResource > FAIL command-line-arguments [build failed] > FAIL > > The symbol PracticeResource is defined in a file called practice_resource > present at the same package. > > ¿Is it possible to archieve this? If anyone know how and can explain me I > will appreciate that. > Thanks in advance. > > I haven't see how to do it in the official doc and in other doc as well.
When testing a package, you normally write "go test" or "go test PACKAGEPATH" without listing any files. Listing files is an unusual case, only used for a standalone test that is not part of a package. Ian -- 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/CAOyqgcVm0bj_OPO01eea5%2BKM45art8B%3DMS0uLRZWKeUknipt%2Bg%40mail.gmail.com.