bump_version

package
v0.0.0-...-d7594d2 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2018 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const Major = VersionType("major")
View Source
const Minor = VersionType("minor")
View Source
const Patch = VersionType("patch")

Variables

This section is empty.

Functions

func SetInFile

func SetInFile(newVersion *Version, filename string) error

SetInFile sets the version in filename to newVersion.

Types

type Version

type Version struct {
	Major int64
	Minor int64
	Patch int64
}

func BumpInFile

func BumpInFile(vtype VersionType, filename string) (*Version, error)

BumpInFile finds a constant named VERSION, version, or Version in the file with the given filename, increments the version per the given VersionType, and writes the file back to disk. Returns the incremented Version object.

func Parse

func Parse(version string) (*Version, error)

ParseVersion parses a version string of the forms "2", "2.3", or "0.10.11". Any information after the third number ("2.0.0-beta") is discarded. Very little effort is taken to validate the input.

If a field is omitted from the string version (e.g. "0.2"), it's stored in the Version string as the integer -1.

func (*Version) String

func (v *Version) String() string

type VersionType

type VersionType string

Jump to

Keyboard shortcuts

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