version

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 2 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package version is the version group: osapi version, which prints the build of the binary.

Index

Constants

This section is empty.

Variables

View Source
var Group = command.Register(command.Define(
	"version", "Display the version of osapi",
	command.Flat(),
	command.Uses[Deps](),
	command.Method[Input, Info]("version").
		Short("Display the version of osapi").
		Long("The build of this binary: the version that each component reports, the\n"+
			"commit and the tree it was built from, and the Go that built it.").
		Example("").
		Prints(sampleInfo).
		Example("--json").
		Handle(Version),
))

Group is the version group's definition. It is flat, so its method is a command of the root: osapi version.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	// Build is the build of the binary, which the release sets with
	// -ldflags in cmd/.
	Build func() Info
}

Deps is what the version group's method uses.

type Info

type Info struct {
	Version   string `                json:"version"`
	Commit    string `                json:"commit"`
	TreeState string `                json:"tree_state"      label:"Tree"`
	BuildDate string `                json:"build_date"      label:"Built"`
	BuiltBy   string `                json:"built_by"`
	GoVersion string `                json:"go_version"      label:"Go"`
	Platform  string `                json:"platform"`
	Compiler  string `                json:"compiler"                      render:"-"`
	ModuleSum string `                json:"module_checksum"               render:"-"`
	// contains filtered or unexported fields
}

Info is the build of the binary.

func Version

func Version(
	_ context.Context,
	d Deps,
	_ Input,
) (Info, error)

Version is the build of the binary.

type Input

type Input struct{}

Input is the input of version, which has none.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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