-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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
cmd/gofmt: go fmt
not working when go:embed file is missing
#43273
Comments
CC @rsc. |
This may be (fairly closely) related to #39442, but this particular issue is specific to the |
Change https://golang.org/cl/280452 mentions this issue: |
There does not seem to be any reason to expect embedded files to be present when
|
go fmt
not working when go:embed file is missinggo fmt
not working when go:embed file is missing
Friendly ping as this is a release blocker and the release is approaching. |
@cagedmantis, this was blocked on #43632. (There is current activity on https://golang.org/cl/280452.) |
Thanks for the update! |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Repository to reproduce issue: https://github.com/mewspring/embed-test
I tried to use
go fmt
to format main.go.The
main.go
source file contains a go:embed directive reading the text fileversion.txt
. This text file is generated by the gen_version.sh script.Trying to run
go fmt
prior to generating theversion.txt
file fails, with the error messagepattern version.txt: no matching files found
.Generating
version.txt
using./gen_version.sh
and then runninggo fmt
succeeds.What did you expect to see?
Go fmt successfully formatting the source code (even if files or directives listed in
go:embed
directive are missing).The contents of
go:embed
directives should only matter for the compilation step, not source code formatting.Note: a warning may still be issued by
go fmt
if preferable, but this should not interrupt the formatting of the source file.What did you see instead?
Trying to run
go fmt
prior to generating theversion.txt
file fails, with the error messagepattern version.txt: no matching files found
.The text was updated successfully, but these errors were encountered: