version

package
v0.0.0-...-f0fa1af Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: MIT Imports: 4 Imported by: 2 modules, 1 package

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

Index

Constants

View Source
const DefaultTitle = `{{.App}} {{.Version}} ({{.GitCommit}}; {{.Go}}/{{.Arch}}; by {{.Author}}; built at {{.BuildDate}})`

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	App       string `json:"app"`
	Author    string `json:"author"`
	Version   string `json:"version"`
	GitCommit string `json:"gitCommit"`
	BuildDate string `json:"buildDate"`
	Go        string `json:"go"`
	Arch      string `json:"arch"`
}

func New

func New(opts ...VersionOptionFunc) *Version

func (*Version) BuildVersionLine

func (v *Version) BuildVersionLine(tmpl *string) (ret string)

func (*Version) SetApp

func (v *Version) SetApp(val string) *Version

func (*Version) SetAuthor

func (v *Version) SetAuthor(val string) *Version

func (*Version) SetBuildDate

func (v *Version) SetBuildDate(val string) *Version

func (*Version) SetGitCommit

func (v *Version) SetGitCommit(val string) *Version

func (*Version) SetVersion

func (v *Version) SetVersion(val string) *Version

func (*Version) Title

func (v *Version) Title(tmpl *string) string

type VersionOptionFunc

type VersionOptionFunc func(*Version)

func WithApp

func WithApp(val string) VersionOptionFunc

WithApp sets the app

func WithAuthor

func WithAuthor(val string) VersionOptionFunc

WithAuthor sets the author

func WithBuildDate

func WithBuildDate(val string) VersionOptionFunc

WithBuildDate sets the build tage

func WithGitCommit

func WithGitCommit(val string) VersionOptionFunc

WithGitCommit sets the git commit

func WithVersion

func WithVersion(val string) VersionOptionFunc

WithVersion sets the version

Jump to

Keyboard shortcuts

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