Help us shape the future of Go! Take the 2026 Go Developer Survey

version

package
v0.9.0 Latest Latest
Warning

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

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

Documentation

Overview

Package version exposes build metadata injected at link time via -ldflags -X.

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   = "dev"
	Commit    = "unknown"
	BuildDate = "unknown"
)

Set via -ldflags "-X github.com/stanterprise/observer/pkg/version.Version=...".

Functions

func Handler

func Handler(w http.ResponseWriter, _ *http.Request)

Handler serves Get() as JSON.

Types

type Info

type Info struct {
	Version   string `json:"version"`
	Commit    string `json:"commit"`
	BuildDate string `json:"buildDate"`
	GoVersion string `json:"goVersion"`
}

Info describes the running build.

func Get

func Get() Info

Get returns build info, falling back to Go VCS stamping for local builds without ldflags.

Jump to

Keyboard shortcuts

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