util

package
v0.0.0-...-d7f1dd7 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEnvVars

func GetEnvVars() map[string]string

GetEnvVars returns all env vars as a map

func GetUserHome

func GetUserHome() string

GetUserHome returns path to user home directory

func MapValues

func MapValues(m map[string]string) []string

MapValues returns array of values of the map

func PathInHome

func PathInHome(file string) string

PathInHome appends path to user home directory

func SubstrAfterLast

func SubstrAfterLast(str string, delimiter string) string

SubstrAfterLast returns substring after last occurrence of delimiter

Types

type Semver

type Semver struct {
	Version *semver.Version
	// contains filtered or unexported fields
}

Semver represents semantic versioning file storage

func Load

func Load(file string) *Semver

Load loads version from file

func New

func New(file string, version *semver.Version) *Semver

New creates new object

func (Semver) Bump

func (s Semver) Bump(newVersion string) string

Bump bumps provided new version or next patch version

func (Semver) Current

func (s Semver) Current() string

Current returns current version

func (Semver) NextSnapshot

func (s Semver) NextSnapshot(newVersion string) string

NextSnapshot bumps next snapshot version

func (Semver) Save

func (s Semver) Save() error

Save saves current state to file

Jump to

Keyboard shortcuts

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