version

package
v0.0.66 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: Apache-2.0 Imports: 2 Imported by: 4

Documentation

Overview

version package provides build-time version information. It is designed to be used via the -ldflags option of go build.

e.g.

go build -ldflags "-X github.com/kunitsucom/util.go/version.version=${BUILD_VERSION} -X github.com/kunitsucom/util.go/version.revision=${BUILD_REVISION} -X github.com/kunitsucom/util.go/version.branch=${BUILD_BRANCH} -X github.com/kunitsucom/util.go/version.timestamp=${BUILD_TIMESTAMP}"

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Branch

func Branch() string

func Revision

func Revision() string

func Timestamp

func Timestamp() string

func Version

func Version() string

Types

type BuildVersion

type BuildVersion struct {
	Version   string `json:"version"`
	Revision  string `json:"revision"`
	Branch    string `json:"branch"`
	Timestamp string `json:"timestamp"`
	GoVersion string `json:"goVersion"`
	GOARCH    string `json:"goarch"`
	GOOS      string `json:"goos"`
}

func ReadBuildVersion

func ReadBuildVersion() BuildVersion

Jump to

Keyboard shortcuts

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