version

package
v6.8.3 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Version   string
	GitCommit string
	Label     string
)

Variables sent at link time via ldflags

Functions

func Get

func Get(options ...Option) string

Get returns the current CLI version, preferring the value set via ldflags Examples:

  • v1.0.0
  • DEV-abcdef1
  • DEV-abcdef1+ (if installed via `make install` with uncommitted changes)
  • unknown

Types

type BuildInfoFetcher

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

BuildInfoFetcher specifies a custom build info fetcher, only really exists for testing

type Config

type Config struct {
	ReadBuildInfo BuildInfoFetcher
}

type Option

type Option func(Config) Config

func WithFetcher

func WithFetcher(fetcher BuildInfoFetcher) Option

WithFetcher allows setting a custom fetcher for build info

Jump to

Keyboard shortcuts

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