diff options
Diffstat (limited to 'src/cmd/go/main.go')
| -rw-r--r-- | src/cmd/go/main.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/cmd/go/main.go b/src/cmd/go/main.go index bf1dad40f..61e629968 100644 --- a/src/cmd/go/main.go +++ b/src/cmd/go/main.go @@ -108,6 +108,7 @@ func setExitStatus(n int) { } func main() { + _ = go11tag flag.Usage = usage flag.Parse() log.SetFlags(0) @@ -129,8 +130,11 @@ func main() { fmt.Fprintf(os.Stderr, "warning: GOPATH set to GOROOT (%s) has no effect\n", gopath) } else { for _, p := range filepath.SplitList(gopath) { - if strings.Contains(p, "~") && runtime.GOOS != "windows" { - fmt.Fprintf(os.Stderr, "go: GOPATH entry cannot contain shell metacharacter '~': %q\n", p) + // Note: using HasPrefix instead of Contains because a ~ can appear + // in the middle of directory elements, such as /tmp/git-1.8.2~rc3 + // or C:\PROGRA~1. Only ~ as a path prefix has meaning to the shell. + if strings.HasPrefix(p, "~") { + fmt.Fprintf(os.Stderr, "go: GOPATH entry cannot start with shell metacharacter '~': %q\n", p) os.Exit(2) } if build.IsLocalImport(p) { @@ -189,6 +193,9 @@ var documentationTemplate = `// Copyright 2011 The Go Authors. All rights reser // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. +// DO NOT EDIT THIS FILE. GENERATED BY mkdoc.sh. +// Edit the documentation in other files and rerun mkdoc.sh to generate this one. + /* {{range .}}{{if .Short}}{{.Short | capitalize}} |
