version

package
v1.65.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildInfoReader

type BuildInfoReader func() (*debug.BuildInfo, bool)

BuildInfoReader is a function type for reading build info, allowing dependency injection for testing.

type Info

type Info struct {
	ModuleVersion string // Module version from build info
	Revision      string // Git commit hash
	Dirty         bool   // Whether working directory had uncommitted changes
	// contains filtered or unexported fields
}

Info holds version information extracted from build metadata.

func Get

func Get(opts ...Option) Info

Get retrieves version information from build metadata using the default debug.ReadBuildInfo.

func (Info) String

func (i Info) String() string

String returns a formatted version string based on the available build version information.

type Option

type Option func(*Info)

func WithReadBuildInfoFunc

func WithReadBuildInfoFunc(f BuildInfoReader) Option

Jump to

Keyboard shortcuts

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