| // Copyright 2013 The Go Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| // The run program is invoked via the dist tool. |
| // To invoke manually: go tool dist test -run api --no-rebuild |
| goroot = os.Getenv("GOROOT") // should be set by run.{bash,bat} |
| log.Fatal("No $GOROOT set.") |
| out, err := exec.Command("go", "tool", "api", |
| "-c", file("go1", "go1.1", "go1.2", "go1.3", "go1.4", "go1.5", "go1.6", "go1.7"), |
| "-except", file("except")).CombinedOutput() |
| log.Fatalf("Error running API checker: %v\n%s", err, out) |
| // file expands s to $GOROOT/api/s.txt. |
| // If there are more than 1, they're comma-separated. |
| func file(s ...string) string { |
| return file(s[0]) + "," + file(s[1:]...) |
| return filepath.Join(goroot, "api", s[0]+".txt") |