-
Notifications
You must be signed in to change notification settings - Fork 17.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmd/go: allow go fmt to complete when embedded file is missing
Fixes #43273 Change-Id: I75fe2e608cb43c048e3c2a22fe7fbb6eb779504a Reviewed-on: https://go-review.googlesource.com/c/go/+/280452 Trust: Jay Conrod <[email protected]> Trust: Bryan C. Mills <[email protected]> Run-TryBot: Jay Conrod <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
- Loading branch information
Showing
2 changed files
with
24 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# go fmt ignores file not found | ||
go fmt xnofmt.go | ||
cmp xnofmt.go xfmt.ref | ||
! go build xnofmt.go | ||
stderr 'xnofmt.go:5:12: pattern missing.txt: no matching files found' | ||
|
||
-- xnofmt.go -- | ||
package p | ||
|
||
import "embed" | ||
|
||
//go:embed missing.txt | ||
var X embed.FS | ||
-- xfmt.ref -- | ||
package p | ||
|
||
import "embed" | ||
|
||
//go:embed missing.txt | ||
var X embed.FS | ||
-- go.mod -- | ||
module m |