versionctrl

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Prepare or load Version.go in fixed directory `./pkg/version/version.go`

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Version

type Version struct {
	PackageName string
	Major       uint64
	Minor       uint64
	Patch       uint64
	// contains filtered or unexported fields
}

Version encapsulates a semantic version as well as a package name.

func VersionInit

func VersionInit(vs, pn string, path ...string) (*Version, error)

Init initializes a `Version.go` file with the specified version string and package name.

func VersionLoad

func VersionLoad(path ...string) (*Version, error)

Load reads `Version.go` in the current directory and loads it into a `*Version` instance.

func (*Version) Increment

func (v *Version) Increment(op string) error

Increment loads the version from the current directory and updates the appropriate component of the semantic version (major, minor or patch).

func (*Version) String

func (v *Version) String() string

String implements the stringer interface for `Version`.

Jump to

Keyboard shortcuts

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