"tour.article",
}
-var fileRe = regexp.MustCompile(`^go\.([a-z0-9-.]+)\.(src|([a-z0-9]+)-([a-z0-9]+))\.`)
+// The os-arches that support the race toolchain.
+var raceAvailable = []string{
+ "darwin-amd64",
+ "linux-amd64",
+ "windows-amd64",
+}
+
+var fileRe = regexp.MustCompile(`^(go[a-z0-9-.]+)\.(src|([a-z0-9]+)-([a-z0-9]+))\.`)
func main() {
flag.Usage = func() {
}
b.OS = p[0]
b.Arch = p[1]
+ if *includeRace {
+ for _, t := range raceAvailable {
+ if t == targ {
+ b.Race = true
+ }
+ }
+ }
}
if err := b.Do(); err != nil {
log.Printf("%s: %v", targ, err)
type Build struct {
Source bool // if true, OS and Arch must be empty
+ Race bool // build race toolchain
OS string
Arch string
root string
} else {
_, err = b.run(src, "bash", "make.bash")
}
- if *includeRace {
+ if b.Race {
if err != nil {
return err
}
if err != nil {
return err
}
- // Re-install std without -race, so that we're not left with
- // a slower, race-enabled cmd/go, cmd/godoc, etc.
+ // Re-install std without -race, so that we're not left
+ // with a slower, race-enabled cmd/go, cmd/godoc, etc.
_, err = b.run(src, goCmd, "install", "-a", "std")
}
if err != nil {