versioninfo

package
v0.0.0-...-dc022f5 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package versioninfo reports build and update metadata for the CLI.

Index

Constants

This section is empty.

Variables

View Source
var (
	GitSHA    = "unknown"
	GitBranch = "unknown"
	GitDirty  = "unknown"
	BuildDate = "unknown"
)

Functions

func RenderString

func RenderString(report Report) string

func RenderText

func RenderText(w io.Writer, report Report)

Types

type Metadata

type Metadata struct {
	GitSHA    string
	GitBranch string
	GitDirty  string
	BuildDate string
}

type Report

type Report struct {
	Kind            string `json:"kind"`
	Action          string `json:"action"`
	Status          string `json:"status"`
	HumanReadable   string `json:"human_readable"`
	Version         string `json:"version"`
	GitSHA          string `json:"git_sha"`
	GitSHAShort     string `json:"git_sha_short"`
	GitBranch       string `json:"git_branch"`
	GitDirty        string `json:"git_dirty"`
	BuildDate       string `json:"build_date"`
	BuildTarget     string `json:"build_target"`
	GoVersion       string `json:"go_version"`
	ModulePath      string `json:"module_path,omitempty"`
	ExecutablePath  string `json:"executable_path,omitempty"`
	WorkspaceGitSHA string `json:"workspace_git_sha,omitempty"`
	WorkspaceMatch  *bool  `json:"workspace_match,omitempty"`
	Hint            string `json:"hint,omitempty"`
}

func Build

func Build(version string, workspace string) Report

func BuildWithMetadata

func BuildWithMetadata(version string, workspace string, metadata Metadata) Report

Jump to

Keyboard shortcuts

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