Fix expected import path for Go cmd/vendor packages.

PiperOrigin-RevId: 557273882
This commit is contained in:
Jamie Liu
2023-08-15 15:44:34 -07:00
committed by gVisor bot
parent 9ca09375e4
commit 16dc811cb7
+4
View File
@@ -742,6 +742,10 @@ func SplitPackages(srcs []string, srcRootPrefix string) map[string][]string {
continue
}
// In Go's sources, vendored packages under cmd/vendor are imported via
// paths not containing cmd/vendor.
pkg = strings.TrimPrefix(pkg, "cmd/vendor/")
// Place the special runtime package (functions emitted by the
// compiler itself) into the runtime packages.
if strings.Contains(filename, "cmd/compile/internal/typecheck/_builtin/runtime.go") {