2023-03-15 16:00:52 +00:00
|
|
|
// Copyright (c) HashiCorp, Inc.
|
|
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2022-12-07 18:29:51 +00:00
|
|
|
package version
|
|
|
|
|
2023-09-06 17:24:39 +00:00
|
|
|
import (
|
|
|
|
_ "embed"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
2022-12-07 18:29:51 +00:00
|
|
|
var (
|
|
|
|
// The git commit that was compiled. This will be filled in by the compiler.
|
|
|
|
GitCommit string
|
|
|
|
GitDescribe string
|
|
|
|
|
|
|
|
// The compilation date. This will be filled in by the compiler.
|
|
|
|
BuildDate string
|
|
|
|
|
|
|
|
// Whether cgo is enabled or not; set at build time
|
|
|
|
CgoEnabled bool
|
|
|
|
|
2023-09-06 17:24:39 +00:00
|
|
|
// Version and VersionPrerelease info are now being embedded directly from the VERSION file.
|
|
|
|
// VersionMetadata is being passed in via ldflags in CI, otherwise the default set here is used.
|
|
|
|
//go:embed VERSION
|
|
|
|
fullVersion string
|
|
|
|
Version, VersionPrerelease, _ = strings.Cut(strings.TrimSpace(fullVersion), "-")
|
|
|
|
VersionMetadata = ""
|
2022-12-07 18:29:51 +00:00
|
|
|
)
|