From ebdd25920efe38996a041351396e551c033606c1 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Mon, 3 Jan 2022 11:44:05 -0800 Subject: [PATCH] go.toolchain.rev: add Go toolchain rev, tool to print it out Updates tailscale/corp#3385 Change-Id: Ia0e285a0ae836744539c97ff6eff207588159688 Signed-off-by: Brad Fitzpatrick --- cmd/printdep/printdep.go | 26 ++++++++++++++++++++++++++ go.toolchain.rev | 1 + version-embed.go | 6 ++++++ 3 files changed, 33 insertions(+) create mode 100644 cmd/printdep/printdep.go create mode 100644 go.toolchain.rev diff --git a/cmd/printdep/printdep.go b/cmd/printdep/printdep.go new file mode 100644 index 000000000..3692f8798 --- /dev/null +++ b/cmd/printdep/printdep.go @@ -0,0 +1,26 @@ +// Copyright (c) 2021 Tailscale Inc & 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 printdep command is a build system tool for printing out information +// about dependencies. +package main + +import ( + "flag" + "fmt" + "strings" + + ts "tailscale.com" +) + +var ( + goToolchain = flag.Bool("go", false, "print the supported Go toolchain git hash (a github.com/tailscale/go commit)") +) + +func main() { + flag.Parse() + if *goToolchain { + fmt.Println(strings.TrimSpace(ts.GoToolchainRev)) + } +} diff --git a/go.toolchain.rev b/go.toolchain.rev new file mode 100644 index 000000000..03ecf9995 --- /dev/null +++ b/go.toolchain.rev @@ -0,0 +1 @@ +118f76c18c3f755ba0e6211e170a6422871f2791 diff --git a/version-embed.go b/version-embed.go index a4b12982c..ba5a2abef 100644 --- a/version-embed.go +++ b/version-embed.go @@ -9,3 +9,9 @@ //go:embed VERSION.txt var Version string + +// GoToolchainRev is the git hash from github.com/tailscale/go that this release +// should be built using. It may end in a newline. +// +//go:embed go.toolchain.rev +var GoToolchainRev string