version

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 2, 2022 License: MIT Imports: 7 Imported by: 29

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Flag

type Flag struct {
	AppName string // The application name to use when printing the version
}

Flag provides a standardised version flag.

func (*Flag) AlternativeName

func (*Flag) AlternativeName() string

AlternativeName returns the alternative flag name (without leading hyphen).

func (*Flag) Description

func (*Flag) Description() string

Description returns a one-line description of this flag.

func (*Flag) IsBoolean

func (*Flag) IsBoolean() bool

IsBoolean returns true.

func (*Flag) Name

func (*Flag) Name() string

Name returns the flag name (without leading hyphen).

func (*Flag) Parse

func (f *Flag) Parse(_ string) error

Parse outputs the version details to os.Stderr and exits.

func (*Flag) Usage

func (*Flag) Usage() string

Usage returns the empty string.

type Info

type Info struct {
	Major     int
	Minor     int
	Patch     int
	GitCommit string
	GitBranch string
	GitDirty  bool
	Date      time.Time
}

Info contains versioning information.

func GetInfo

func GetInfo() Info

GetInfo returns the known version info.

func (Info) String

func (i Info) String() string

String returns a string summarising the version.

func (Info) Version

func (i Info) Version() string

Version returns the version as a string with leading "v".

Jump to

Keyboard shortcuts

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