build

package
v0.0.0-...-80055c2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package build provides a way to get information about the current build.

Note that you need to build with the full package path to correctly insert the build information.

E.g.:

go build -o bin/helper github.com/philiplinell/commit-msg/cmd/cli

instead of

go build -o bin/helper ./cmd/cli/*.go

See more here: https://github.com/golang/go/issues/51831

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Info

type Info struct {
	// Commit - the commit identifier for the current build.
	Commit string

	// Dirty - true if the source tree had local modifications.
	Dirty bool

	// ModificationTime - the modification time associated with the commit.
	ModificationTime time.Time
}

func GetInfo

func GetInfo() (*Info, error)

GetInfo - returns the build information.

func (*Info) String

func (i *Info) String() string

String - returns a string representation of the build info.

Jump to

Keyboard shortcuts

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