aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile
diff options
context:
space:
mode:
authorkorzhao <korzhao95@gmail.com>2021-08-17 19:34:40 +0800
committerAlexander Rakoczy <alex@golang.org>2021-08-25 18:31:07 +0000
commit4f2ebfe34be7453ab144d82558cc4e735a55d644 (patch)
treeb7e67a48b93e341cafa4d964d073fea6d6808f93 /src/cmd/compile
parentd2f002cb39bebdfac560282a43f3199c5d0903d7 (diff)
downloadgo-4f2ebfe34be7453ab144d82558cc4e735a55d644.tar.gz
go-4f2ebfe34be7453ab144d82558cc4e735a55d644.zip
cmd/compile: allow embed into any byte slice type
Fixes #47735 Change-Id: Ia21ea9a67f36a3edfef1b299ae4f3b00c306cd68 Reviewed-on: https://go-review.googlesource.com/c/go/+/342851 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Alexander Rakoczy <alex@golang.org>
Diffstat (limited to 'src/cmd/compile')
-rw-r--r--src/cmd/compile/internal/staticdata/embed.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/staticdata/embed.go b/src/cmd/compile/internal/staticdata/embed.go
index 0730d346b2..627c98ba44 100644
--- a/src/cmd/compile/internal/staticdata/embed.go
+++ b/src/cmd/compile/internal/staticdata/embed.go
@@ -73,7 +73,7 @@ func embedKind(typ *types.Type) int {
if typ.Kind() == types.TSTRING {
return embedString
}
- if typ.Sym() == nil && typ.IsSlice() && typ.Elem().Kind() == types.TUINT8 {
+ if typ.IsSlice() && typ.Elem().Kind() == types.TUINT8 {
return embedBytes
}
return embedUnknown