diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index b29f7d10ae3..e7011646c3e 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -16,6 +16,7 @@ import ( "log" "os" "path" + "runtime" "strconv" "strings" ) @@ -571,7 +572,7 @@ func isDriveLetter(b byte) bool { // is this path a local name? begins with ./ or ../ or / func islocalname(name string) bool { return strings.HasPrefix(name, "/") || - Ctxt.Windows != 0 && len(name) >= 3 && isDriveLetter(name[0]) && name[1] == ':' && name[2] == '/' || + runtime.GOOS == "windows" && len(name) >= 3 && isDriveLetter(name[0]) && name[1] == ':' && name[2] == '/' || strings.HasPrefix(name, "./") || name == "." || strings.HasPrefix(name, "../") || name == ".." } @@ -893,7 +894,7 @@ func mkpackage(pkgname string) { if i := strings.LastIndex(p, "/"); i >= 0 { p = p[i+1:] } - if Ctxt.Windows != 0 { + if runtime.GOOS == "windows" { if i := strings.LastIndex(p, `\`); i >= 0 { p = p[i+1:] } diff --git a/src/cmd/internal/obj/link.go b/src/cmd/internal/obj/link.go index 8cae1255cd0..e2993630a9a 100644 --- a/src/cmd/internal/obj/link.go +++ b/src/cmd/internal/obj/link.go @@ -618,7 +618,6 @@ type Link struct { Flag_optimize bool Bso *Biobuf Pathname string - Windows int32 Goroot string Goroot_final string Hash map[SymVer]*LSym diff --git a/src/cmd/internal/obj/sym.go b/src/cmd/internal/obj/sym.go index 41623266f59..a723eb4689d 100644 --- a/src/cmd/internal/obj/sym.go +++ b/src/cmd/internal/obj/sym.go @@ -35,7 +35,6 @@ import ( "log" "os" "path/filepath" - "runtime" "strconv" ) @@ -83,10 +82,6 @@ func Linknew(arch *LinkArch) *Link { ctxt.Version = HistVersion ctxt.Goroot = Getgoroot() ctxt.Goroot_final = os.Getenv("GOROOT_FINAL") - if runtime.GOOS == "windows" { - // TODO(rsc): Remove ctxt.Windows and let callers use runtime.GOOS. - ctxt.Windows = 1 - } var buf string buf, _ = os.Getwd()