buildinfo

package
v0.6.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadModuleVersion added in v0.5.0

func ReadModuleVersion() (string, error)

ReadModuleVersion reads the build information of the running executable and evaluates the cqlc package version.

Types

type BuildInfo

type BuildInfo struct {
	// Version is the version of the binary
	Version string `json:"version"`
	// Commit is the git commit hash
	Commit string `json:"commit"`
	// Time is the build date
	Time time.Time `json:"time"`
	// GoVersion is the version of the Go toolchain that built the binary
	GoVersion string `json:"go.version"`
}

BuildInfo contains information about the build

func ParseBuildInfo

func ParseBuildInfo(flags *Flags) (*BuildInfo, error)

ParseBuildInfo parses the build information from the flags and the debug build information

type Flags

type Flags struct {
	// Version is the version of the binary
	Version string `validate:"required,semver"`
}

Flags contains the build information originated from the ldflags

Jump to

Keyboard shortcuts

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