Help us shape the future of Go! Take the 2026 Go Developer Survey

version

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version (e.g., "1.0.0")
	Version = "dev"
	// GitCommit is the git commit hash
	GitCommit = "unknown"
	// BuildDate is the build date in RFC3339 format
	BuildDate = "unknown"
	// GoVersion is the Go version used to build
	GoVersion = runtime.Version()
	// Platform is the OS/Arch combination
	Platform = fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH)
)

Version information. These variables are set at build time using ldflags.

Functions

This section is empty.

Types

type Info

type Info struct {
	Version   string `json:"version"`
	GitCommit string `json:"gitCommit"`
	BuildDate string `json:"buildDate"`
	GoVersion string `json:"goVersion"`
	Platform  string `json:"platform"`
}

Info represents version information

func GetVersion

func GetVersion() Info

GetVersion returns the current version information

func (Info) JSON

func (i Info) JSON() (string, error)

JSON returns the version information as JSON

func (Info) String

func (i Info) String() string

String returns a human-readable version string

Jump to

Keyboard shortcuts

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