version

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2024 License: ISC Imports: 5 Imported by: 0

Documentation

Overview

Package version provides the version and build information.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CmdName

func CmdName() string

CmdName returns the base name of the current binary.

func UserAgent added in v0.3.0

func UserAgent() string

UserAgent returns a user agent string by combining the version information and a special URL leading to bot information page.

Types

type Info

type Info struct {
	Name    string `json:"name"`     // name of the program
	Version string `json:"version"`  // BuildInfo's module version
	Commit  string `json:"commit"`   // BuildInfo's vcs.revision
	BuiltAt string `json:"built_at"` // BuildInfo's vcs.date
	Dirty   bool   `json:"dirty"`    // BuildInfo's vcs.modified
	Go      string `json:"go"`       // runtime.Version()
	OS      string `json:"os"`       // runtime.GOOS
	Arch    string `json:"arch"`     // runtime.GOARCH
}

Info is the version and build information of the current binary.

func Version

func Version() Info

Version returns the version and build information of the current binary.

func (Info) String

func (i Info) String() string

String implements the fmt.Stringer interface.

Jump to

Keyboard shortcuts

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