vergen

package
v0.0.0-...-1ad5891 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: MIT Imports: 7 Imported by: 0

README

vergen

Vergen generates version info with go generate.

Refs

Documentation

Overview

Package vergen generate version info with go generate

Index

Constants

View Source
const (
	DefaultPkgName     = "version"
	DefaultDirtyString = "+"
	DefaultTimeout     = 15 * time.Second
)

Variables

View Source
var DirtyString = DefaultDirtyString

DirtyString is a string appended to the VgVersion constant if you have uncommitted changes in your current repo.

View Source
var IgnoreFiles = []string{"version.go"}

IgnoreFiles is an array of filenames that vergen should ignore when trying to detect uncommitted changes. By default it contains only "version.go" which if it is the only file changed doesn't affect the runtime behaviour of your software.

View Source
var Timeout = DefaultTimeout

Timeout is of type time.Duration and is the amount of time vergen will wait for each git command it runs to complete before killing it.

Functions

func Create

func Create() error

Create will create a file named version.go in the directory you ran 'go generate', that will contain three constants:

VgVersion: The version of your repo as given by 'git describe --tags' plus the DirtyString variable if you have uncommitted changes.

VgHash: The SHA1 hash of your current commit.

VgClean: indicates whether your build is clean or it includes uncommitted changes.

func CreateFile

func CreateFile(filename string) error

CreateFile will work as Create() but instead of writing version.go in the directory you ran 'go generate' in, it will write filename instead (which may include a path).

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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