version

package
v1.10.0 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 4 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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