Skip to content

Commit

Permalink
version: embed VERSION.txt in unstamped version
Browse files Browse the repository at this point in the history
Temporary measure until we switch to Go 1.18.

    $ go run ./cmd/tailscale version
    1.17.0-date.20211022
      go version: go1.17

Updates #81

Change-Id: Ic82ebffa5f46789089e5fb9810b3f29e36a47f1a
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
  • Loading branch information
bradfitz committed Oct 22, 2021
1 parent 09e692e commit 4324561
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions version-embed.go
@@ -0,0 +1,11 @@
// 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.

// Package tailscaleroot embeds VERSION.txt into the binary.
package tailscaleroot

import _ "embed"

//go:embed VERSION.txt
var Version string
12 changes: 11 additions & 1 deletion version/version.go
Expand Up @@ -5,10 +5,20 @@
// Package version provides the version that the binary was built at.
package version

import (
"strings"

tailscaleroot "tailscale.com"
)

// Long is a full version number for this build, of the form
// "x.y.z-commithash", or "date.yyyymmdd" if no actual version was
// provided.
var Long = "date.20211004"
var Long = "date.20211022"

func init() {
Long = strings.TrimSpace(tailscaleroot.Version) + "-" + Long
}

// Short is a short version number for this build, of the form
// "x.y.z", or "date.yyyymmdd" if no actual version was provided.
Expand Down

0 comments on commit 4324561

Please sign in to comment.