]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: change error message to refer to correct bootstrap command
authorAlex Brainman <alex.brainman@gmail.com>
Fri, 2 Aug 2013 05:55:21 +0000 (15:55 +1000)
committerAlex Brainman <alex.brainman@gmail.com>
Fri, 2 Aug 2013 05:55:21 +0000 (15:55 +1000)
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/12317043

src/cmd/go/build.go

index 0c9e561538fc09086ac7530a39c90b8c85cb1661..f43063290aa5b6ecc22ccb1ef48d06cff13c43c1 100644 (file)
@@ -772,7 +772,7 @@ func (b *builder) build(a *action) (err error) {
 
        if a.p.Standard && a.p.ImportPath == "runtime" && buildContext.Compiler == "gc" &&
                !hasString(a.p.HFiles, "zasm_"+buildContext.GOOS+"_"+buildContext.GOARCH+".h") {
-               return fmt.Errorf("%s/%s must be bootstrapped using make.bash", buildContext.GOOS, buildContext.GOARCH)
+               return fmt.Errorf("%s/%s must be bootstrapped using make%v", buildContext.GOOS, buildContext.GOARCH, defaultSuffix())
        }
 
        // Make build directory.
@@ -2242,3 +2242,16 @@ func raceInit() {
        buildContext.InstallSuffix += "race"
        buildContext.BuildTags = append(buildContext.BuildTags, "race")
 }
+
+// defaultSuffix returns file extension used for command files in
+// current os environment.
+func defaultSuffix() string {
+       switch runtime.GOOS {
+       case "windows":
+               return ".bat"
+       case "plan9":
+               return ".rc"
+       default:
+               return ".bash"
+       }
+}