version: add support for setting version with the -X Go linker flag

Updates tailscale/tailscale#486

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur 2020-06-22 21:48:12 +02:00 committed by Brad Fitzpatrick
parent 6fbd1abcd3
commit c2682553ff
2 changed files with 13 additions and 2 deletions

View File

@ -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

11
version/xversion.go Normal file
View File

@ -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 = "<not set>"
var SHORT string = "<not set>"