mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 19:43:44 +00:00
2fdcabdcce
This adds the `Version()` function of the `runtime` package which embeds the go version that was used to build tinygo. For programs that are compiled with tinygo the version can be overriden via the: `tinygo build -ldflags="-X 'runtime.buildVersion=abc'"` flag. Otherwise it will continue to use the go version with which tinygo was compiled.
18 lines
443 B
Go
18 lines
443 B
Go
package runtime
|
|
|
|
func Callers(skip int, pc []uintptr) int {
|
|
return 0
|
|
}
|
|
|
|
// buildVersion is the Tinygo tree's version string at build time.
|
|
//
|
|
// This is set by the linker.
|
|
var buildVersion string
|
|
|
|
// Version returns the Tinygo tree's version string.
|
|
// It is the same as goenv.Version, or in case of a development build,
|
|
// it will be the concatenation of goenv.Version and the git commit hash.
|
|
func Version() string {
|
|
return buildVersion
|
|
}
|