version

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Hash = func() string {
	if info, ok := debug.ReadBuildInfo(); ok {
		modified := false
		for _, setting := range info.Settings {
			if setting.Key == "vcs.modified" && setting.Value == "true" {
				modified = true
				break
			}
		}
		for _, setting := range info.Settings {
			if setting.Key == "vcs.revision" {
				shortHash := setting.Value[:7]
				if modified {
					return shortHash + "-dirty"
				}
				return shortHash
			}
		}
	}
	return ""
}()
View Source
var Version string
View Source
var VersionOrHash = func() string {
	if Version != "" {
		return Version
	}
	return Hash
}()

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL