cmd/go: hide the "TERM" environment variable from "go env"

It's implementation detail.

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/63690043
This commit is contained in:
Shenghou Ma 2014-02-14 00:38:55 -05:00
parent af545660d5
commit 6a9b98888e
1 changed files with 10 additions and 12 deletions

View File

@ -85,18 +85,16 @@ func runEnv(cmd *Command, args []string) {
return
}
switch runtime.GOOS {
default:
for _, e := range env {
fmt.Printf("%s=\"%s\"\n", e.name, e.value)
}
case "plan9":
for _, e := range env {
fmt.Printf("%s='%s'\n", e.name, strings.Replace(e.value, "'", "''", -1))
}
case "windows":
for _, e := range env {
fmt.Printf("set %s=%s\n", e.name, e.value)
for _, e := range env {
if e.name != "TERM" {
switch runtime.GOOS {
default:
fmt.Printf("%s=\"%s\"\n", e.name, e.value)
case "plan9":
fmt.Printf("%s='%s'\n", e.name, strings.Replace(e.value, "'", "''", -1))
case "windows":
fmt.Printf("set %s=%s\n", e.name, e.value)
}
}
}
}