version

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version provides application release and build metadata.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the application release version. Can be set via -ldflags at build time.
	Version = "dev"
	// Commit is the git commit SHA. Can be set via -ldflags at build time.
	Commit = "none"
	// BuildDate is the RFC3339 build or commit timestamp. Can be set via -ldflags at build time.
	BuildDate = "unknown"
)

Functions

This section is empty.

Types

type Info

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

Info contains build and runtime version information.

func Get

func Get() Info

Get returns the current version and build information, falling back to runtime build info if build-time variables are unset.

func (Info) JSON

func (i Info) JSON() ([]byte, error)

JSON returns the Info marshaled as indented JSON.

func (Info) String

func (i Info) String() string

String returns a human-readable one-line representation of the version info.

Jump to

Keyboard shortcuts

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