aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/staticdata
diff options
context:
space:
mode:
authorMatthew Dempsky <mdempsky@google.com>2022-05-13 16:07:06 -0700
committerMatthew Dempsky <mdempsky@google.com>2022-05-16 20:19:45 +0000
commit2540f4e49d47f951de6c7697acdc510bcb7b3ed1 (patch)
tree8193e543d57299fd49de6cd798bb985b9b9fc0fd /src/cmd/compile/internal/staticdata
parent99d63007a00c07bdb9571d2a206c55b72fe1295e (diff)
downloadgo-2540f4e49d47f951de6c7697acdc510bcb7b3ed1.tar.xz
cmd/compile: remove base.Ctxt.Pkgpath fallback paths
Historically, the compiler set types.LocalPkg.Path to "", so a lot of compiler code checks for this, and then falls back to using base.Ctxt.Pkgpath instead. Since CL 393715, we now initialize types.LocalPkg.Path to base.Ctxt.Pkgpath, so these code paths can now simply rely on Pkg.Path always being meaningful. Updates #51734. Change-Id: I0aedbd7cf8e14edbfef781106a9510344d468f2c Reviewed-on: https://go-review.googlesource.com/c/go/+/406317 TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> Auto-Submit: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/staticdata')
-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 48eaa07a5e..8d4dedff59 100644
--- a/src/cmd/compile/internal/staticdata/embed.go
+++ b/src/cmd/compile/internal/staticdata/embed.go
@@ -67,7 +67,7 @@ func embedFileList(v *ir.Name, kind int) []string {
// embedKind determines the kind of embedding variable.
func embedKind(typ *types.Type) int {
- if typ.Sym() != nil && typ.Sym().Name == "FS" && (typ.Sym().Pkg.Path == "embed" || (typ.Sym().Pkg == types.LocalPkg && base.Ctxt.Pkgpath == "embed")) {
+ if typ.Sym() != nil && typ.Sym().Name == "FS" && typ.Sym().Pkg.Path == "embed" {
return embedFiles
}
if typ.Kind() == types.TSTRING {