-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
go/packages: Package.OtherFiles contains globs #69555
Comments
Worse than that, if the embed directive is something like:
then OtherFiles includes the "path":
(exactly like that, including the space) |
Hi @josharian, I can't reproduce it at tip using the code below (a patch to gopackages).
Observe that the log statement shows no rogue OtherFiles, but EmbedPatterns contains globs as it should. Could you provide a repro in a similar form? Thanks. |
Hmm. Trying to bisect between my code and yours... In the meantime, FYI, LoadMode.String is missing a few of the newer Need* constants. |
Change https://go.dev/cl/614875 mentions this issue: |
OK, found the problem. This is in go-fuzz, in code so old NeedEmbed didn't exist...so it was manually working around it. :( So this was entirely user error. Sorry about the noise. |
It had neglected some newer entries. Also, eliminate unnecessary tokens in the string. Also, document the Load* mode bit sets. They may be deprecated but they are useful, convenient, and widely used. Sometime remind me why they are deprecated. Updates golang/go#69555 Change-Id: Id0316cc1e9d39adf64e20db5194b867c3d19ab5d Reviewed-on: https://go-review.googlesource.com/c/tools/+/614875 Auto-Submit: Alan Donovan <adonovan@google.com> Commit-Queue: Alan Donovan <adonovan@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Michael Matloob <matloob@golang.org>
Go version
go version go1.23.1
Output of
go env
in your module/workspace:What did you do?
Used go/packages on a package containing this code:
Then did:
What did you see happen?
Got output like:
That
*
comes from the go:embed directive, I believe.What did you expect to see?
The glob being fully resolved. The docs for OtherFiles say:
*
is not an absolute file path in this case. :)The text was updated successfully, but these errors were encountered: