version

package
v0.0.0-...-e4ac98d Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version string

Version is a build-time variable that users can set to override the version string.

It can be set using: -ldflags "-X github.com/ripta/rt/pkg/version.Version=1.2.3"

Functions

func GetString

func GetString() string

GetString returns the version as a string. If the Version package variable is set, it returns that value. Otherwise, it attempts to get the version from the build info. If _that_ fails, it returns empty string, which you may presumably want to handle.

func NewCommand

func NewCommand() *cobra.Command

Types

type Info

type Info struct {
	// BuildInfo contains the Go build information from the binary
	*debug.BuildInfo
	// Version is the formatted version string
	Version string
}

Info contains version information about the build.

func Get

func Get() (*Info, error)

Get retrieves the version information from the build info. This relies on the vcs.revision and vcs.modified build settings. If the binary was built without module support, it returns an error.

Jump to

Keyboard shortcuts

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