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.
>

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/CABx2%3DD9QgdxNo-dCuH8b1Z61V3qmJH4u8t_fNpMrx8BGFT3obw%40mail.gmail.com.

Reply via email to