You can look at how your IDE would do it, or, you can put a build tag in and only test that build tag
Op zaterdag 29 juni 2024 om 03:37:28 UTC+2 schreef Kurtis Rader: > On Fri, Jun 28, 2024 at 3:25 PM Victor Manuel “Vitu” Giordano < > vituc...@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. >> > > If the reason you're doing this is because you want to run only the tests > in that file rather than all tests for the package you should instead use > the "-run" flag to specify which tests you want to run and specify a > package rather than a single test file. See "go help testflag". > > -- > Kurtis Rader > Caretaker of the exceptional canines Junior and Hank > -- 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/60fc7fef-fa41-4d1d-bed5-83e9705dcdfcn%40googlegroups.com.