versioninfo

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 8 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 versioninfo reports build and update metadata for the CLI.

Index

Constants

View Source
const Current = "0.1.2"

Current is the semantic version reported by Codog binaries and protocols.

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