mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-15 16:33:40 +00:00
Move gitSha1 build time variable from main to goenv package
Moving and exporting this variable from the main to the goenv package allows us to use it from both the main and the builder package. This is done in preparation to include the value in `tinygo build` linker flags, so that we can embed the version and git sha into binaries built with tinygo.
This commit is contained in:
@@ -14,6 +14,12 @@ import (
|
||||
// Update this value before release of new version of software.
|
||||
const Version = "0.23.0-dev"
|
||||
|
||||
var (
|
||||
// This variable is set at build time using -ldflags parameters.
|
||||
// See: https://stackoverflow.com/a/11355611
|
||||
GitSha1 string
|
||||
)
|
||||
|
||||
// GetGorootVersion returns the major and minor version for a given GOROOT path.
|
||||
// If the goroot cannot be determined, (0, 0) is returned.
|
||||
func GetGorootVersion(goroot string) (major, minor int, err error) {
|
||||
|
||||
Reference in New Issue
Block a user