build

package
v0.37.16 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2024 License: AGPL-3.0 Imports: 3 Imported by: 3

Documentation

Overview

Package build contains information about the build that injected at build-time.

To use this package, simply import it in your program, then add build arguments like the following:

go build -ldflags "-X github.com/onflow/flow-go/cmd/build.semver=v1.0.0"

Index

Constants

This section is empty.

Variables

View Source
var UndefinedVersionError = fmt.Errorf("version is undefined")

Functions

func Commit

func Commit() string

Commit returns the commit at which this build was created.

func IsDefined

func IsDefined(v string) bool

IsDefined determines whether a version string is defined. Inputs should have been produced from this package.

func Semver

func Semver() (*smv.Version, error)

Semver returns the semantic version of this build as a semver.Version if it is defined, or UndefinedVersionError otherwise. The version string is converted to a semver compliant one if it isn't already but this might fail if the version string is still not semver compliant. In that case, an error is returned.

func Version added in v0.32.0

func Version() string

Version returns the raw version string of this build.

Types

This section is empty.

Jump to

Keyboard shortcuts

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