cmd/printdep: add --next flag to use rc Go build hash instead
Updates tailscale/corp#36382 Change-Id: Ib7474b0aab901e98f0fe22761e26fd181650743c Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
a374cc344e
commit
8f8236feb3
@@ -19,6 +19,7 @@ var (
|
||||
goToolchain = flag.Bool("go", false, "print the supported Go toolchain git hash (a github.com/tailscale/go commit)")
|
||||
goToolchainURL = flag.Bool("go-url", false, "print the URL to the tarball of the Tailscale Go toolchain")
|
||||
alpine = flag.Bool("alpine", false, "print the tag of alpine docker image")
|
||||
next = flag.Bool("next", false, "if set, modifies --go or --go-url to use the upcoming/unreleased/rc Go release version instead")
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -27,8 +28,12 @@ func main() {
|
||||
fmt.Println(strings.TrimSpace(ts.AlpineDockerTag))
|
||||
return
|
||||
}
|
||||
goRev := strings.TrimSpace(ts.GoToolchainRev)
|
||||
if *next {
|
||||
goRev = strings.TrimSpace(ts.GoToolchainNextRev)
|
||||
}
|
||||
if *goToolchain {
|
||||
fmt.Println(strings.TrimSpace(ts.GoToolchainRev))
|
||||
fmt.Println(goRev)
|
||||
}
|
||||
if *goToolchainURL {
|
||||
switch runtime.GOOS {
|
||||
@@ -36,6 +41,6 @@ func main() {
|
||||
default:
|
||||
log.Fatalf("unsupported GOOS %q", runtime.GOOS)
|
||||
}
|
||||
fmt.Printf("https://github.com/tailscale/go/releases/download/build-%s/%s-%s.tar.gz\n", strings.TrimSpace(ts.GoToolchainRev), runtime.GOOS, runtime.GOARCH)
|
||||
fmt.Printf("https://github.com/tailscale/go/releases/download/build-%s/%s-%s.tar.gz\n", goRev, runtime.GOOS, runtime.GOARCH)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user