Attempt to build / compile a go:embed statement after a rune declaration of '"':
package y
import (
_ "embed"
)
varx='"'//go:embed a.txtvarafile []byte
What did you expect to see?
No error.
What did you see instead?
ken@ken-desktop:~/y$ go build
# y
./y.go:9:3: invalid go:embed: build system did not supply embed configuration
It's worth noting that this compiles without issue:
package y
import (
_ "embed"
)
varx='a'//go:embed a.txtvarafile []byte
This also compiles without issue:
package y
import (
_ "embed"
)
//go:embed a.txtvarafile []bytevarx='"'
The text was updated successfully, but these errors were encountered:
ianlancetaylor
changed the title
embed: issue using go:embed after a rune '"' declaration
go/build: embed reader does not handle a rune literal containing a doublequote character
Nov 11, 2021
What version of Go are you using (
go version
)?Also checked on a macOS and Windows VM, and had the same issue.
Does this issue reproduce with the latest release?
Yes. Additionally, this was checked on go1.17.3 on a macOS and Windows VM and generated the same error.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Attempt to build / compile a
go:embed
statement after a rune declaration of'"'
:What did you expect to see?
No error.
What did you see instead?
It's worth noting that this compiles without issue:
This also compiles without issue:
The text was updated successfully, but these errors were encountered: