version

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package version exposes build metadata for the StackSentry binary.

Release builds inject values through -ldflags, for example:

go build -ldflags "-X github.com/6-SlX-6/stacksentry/internal/version.Version=0.1.0"

Index

Constants

This section is empty.

Variables

View Source
var (
	// Version is the semantic version of the scanner without a leading "v".
	Version = "0.1.0"
	// Commit is the source revision the binary was built from.
	Commit = ""
	// Date is the UTC build timestamp in RFC 3339 format.
	Date = ""
)

These variables are overridden at link time by release builds.

Functions

This section is empty.

Types

type Info

type Info struct {
	Version   string `json:"version"`
	Commit    string `json:"commit,omitempty"`
	Date      string `json:"date,omitempty"`
	GoVersion string `json:"go_version"`
	Platform  string `json:"platform"`
}

Info describes the running binary.

func Get

func Get() Info

Get returns the build information of the running binary. When the binary was built without link-time metadata (for example via "go install"), the VCS revision recorded by the Go toolchain is used as a fallback.

func (Info) String

func (i Info) String() string

String renders a single human-readable version line.

Jump to

Keyboard shortcuts

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