version

package
v1.1.29 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package version - Because semantic versioning is cheaper than therapy

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	Version     string    // Semantic version (or whatever we feel like)
	BuildTime   time.Time // When this all started
	GitCommit   string    // The commit we're blaming
	GitBranch   string    // Which branch caused this mess
	GoVersion   string    // Which Go version to complain about
	Platform    string    // What we're running on
	Environment string    // prod/staging/dev/whoknows
}

Info holds all the version information in one neat package Like a CVS but for your software's identity crisis

func Get

func Get() Info

Get returns structured version info that's actually useful

func (Info) String

func (i Info) String() string

String returns a human-readable version string For when you need to print it all in one line

func (Info) ToMap

func (i Info) ToMap() map[string]string

ToMap converts Info to a map[string]string For APIs that prefer key-value pairs

Jump to

Keyboard shortcuts

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