On Wed, May 1, 2024 at 2:36 PM Menno van Rahden <
menno....@gmail.com> wrote:
>
> Hello, I'm trying to tweak the Go stdlib test cmd a bit to support certain directives, but hitting some resistance.
>
> I'd like to understand why the `load.Package.Internal.Build` instances for `ptest` and `pxtest` (see:
https://cs.opensource.google/go/go/+/master:src/cmd/go/internal/test/test.go;drc=0159150a4aa0b10f9845af94726cd67ffee93b75;l=1111) don't contain the Directives, even though the fields `load.Package.[EmbedPatterns|TestEmbedPatterns|XTestEmbedPatterns]` are populated correctly.
> Print-out the values for embed patterns and Directives.
>
> Reproducing this is pretty simple:
> Create a project with a package with a test file and a test-package file (for xtest). Add random directives (e.g. `//go:generate echo "hello world"` and `//go embed <some-file>`) and execute the tests with the freshly built binary.
>
> Does anybody by any change know how to achieve that these fields are set consistently and can lead me in the right direction?