version

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package version provides build and version information for Spotter

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version of the build
	Version = "dev"

	// CommitHash is the git commit hash of the build
	CommitHash = "unknown"

	// BuildDate is the date when the binary was built
	BuildDate = "unknown"

	// GoVersion is the Go version used to build the binary
	GoVersion = "unknown"
)

Build information. These values are set via ldflags during build.

Functions

func GetBuildDate

func GetBuildDate() string

GetBuildDate returns just the build date

func GetCommitHash

func GetCommitHash() string

GetCommitHash returns just the commit hash

func GetGoVersion

func GetGoVersion() string

GetGoVersion returns just the Go version

func GetPlatform

func GetPlatform() string

GetPlatform returns the platform information

func GetVersion

func GetVersion() string

GetVersion returns just the version string

func IsDevBuild

func IsDevBuild() bool

IsDevBuild returns true if this is a development build

Types

type Info

type Info struct {
	Version    string `json:"version"`
	CommitHash string `json:"commit_hash"`
	BuildDate  string `json:"build_date"`
	GoVersion  string `json:"go_version"`
	Platform   string `json:"platform"`
}

Info represents version and build information

func Get

func Get() Info

Get returns the version information

func (Info) Short

func (i Info) Short() string

Short returns a short version string

func (Info) String

func (i Info) String() string

String returns a formatted version string

Jump to

Keyboard shortcuts

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