version

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Version = func() VersionInfo {
	var info VersionInfo
	if build, ok := debug.ReadBuildInfo(); ok {
		for _, setting := range build.Settings {
			switch setting.Key {
			case "vcs.revision":
				info.Commit = setting.Value[:7]
			case "vcs.time":
				d, _ := time.Parse(time.RFC3339, setting.Value)
				info.CommitTime = d.Format("20060102150405")
			}
		}
	}
	return info
}()

Functions

This section is empty.

Types

type VersionInfo

type VersionInfo struct {
	Commit     string
	CommitTime string
}

func (VersionInfo) String

func (v VersionInfo) String() string

Jump to

Keyboard shortcuts

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