version

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package version provides shared version information and a reusable version command for azd extensions, eliminating duplicated version boilerplate.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand(info *Info, outputFormat *string) *cobra.Command

NewCommand creates a version command that displays extension version info. outputFormat is an optional pointer to a global output format flag (e.g. "json"). If nil, defaults to human-readable output.

Types

type Info

type Info struct {
	Version     string `json:"version"`
	BuildDate   string `json:"buildDate"`
	GitCommit   string `json:"gitCommit"`
	ExtensionID string `json:"extensionId"`
	Name        string `json:"name"`
}

Info holds version information for an extension.

func New

func New(extensionID, name string) *Info

New creates a new Info with default values. Version, BuildDate, GitCommit are expected to be set via ldflags at build time.

func (*Info) String

func (i *Info) String() string

String returns a human-readable version string.

Jump to

Keyboard shortcuts

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