From c2682553fffdb1b3323431d567be1f008ef73de4 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Mon, 22 Jun 2020 21:48:12 +0200 Subject: [PATCH] version: add support for setting version with the -X Go linker flag Updates tailscale/tailscale#486 Signed-off-by: Elias Naur --- version/version.go | 4 ++-- version/xversion.go | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) create mode 100644 version/xversion.go diff --git a/version/version.go b/version/version.go index c471fac71..bb9b77c91 100644 --- a/version/version.go +++ b/version/version.go @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. -// +build !redo +// +build !redo,!xversion // Package version provides the version that the binary was built at. package version -const LONG = "date.20200618" +const LONG = "date.20200622" const SHORT = LONG diff --git a/version/xversion.go b/version/xversion.go new file mode 100644 index 000000000..50e2b30b8 --- /dev/null +++ b/version/xversion.go @@ -0,0 +1,11 @@ +// Copyright (c) 2020 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. + +// +build !redo,xversion + +package version + +// Replaced at build time with the Go linker flag -X. +var LONG string = "" +var SHORT string = ""