goutil

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryPathList

func BinaryPathList(path string) ([]string, error)

func GetLatestVer

func GetLatestVer(modulePath string) (string, error)

GetLatestVer executes "go list -m -f {{.Version}} <importPath>@latest"

func GetPackageVersion

func GetPackageVersion(cmdName string) string

func GoBin

func GoBin() (string, error)

func GoVersionWithOptionM

func GoVersionWithOptionM(bin string) ([]string, error)

GoVersionWithOptionM returns result of "go version -m"

func Install

func Install(importPath string, buildFlags *config.BuildFlags) error

func IsAlreadyUpToDate

func IsAlreadyUpToDate(ver Version) bool

Types

type GoPaths

type GoPaths struct {
	GOBIN  string
	GOPATH string
	// TmpPath is tmporary path for dry run
	TmpPath string
}

func NewGoPaths

func NewGoPaths() *GoPaths

func (*GoPaths) EndDryRunMode

func (gp *GoPaths) EndDryRunMode() error

func (*GoPaths) StartDryRunMode

func (gp *GoPaths) StartDryRunMode() error

StartDryRunMode changes the GOBIN or GOPATH settings to install the binaries in the temporary directory.

type Package

type Package struct {
	Name       string
	ImportPath string
	// ModulePath is path where go.mod is stored
	ModulePath string
	Version    *Version
	BuildFlags *config.BuildFlags
}

func GetPackageInformation

func GetPackageInformation(binList []string) ([]Package, error)

func (*Package) CurrentToLatestStr

func (p *Package) CurrentToLatestStr() string

CurrentToLatestStr returns string about the current version and the latest version

func (*Package) SetCurrentVer

func (p *Package) SetCurrentVer()

func (*Package) SetLatestVer

func (p *Package) SetLatestVer()

func (*Package) VersionCheckResultStr

func (p *Package) VersionCheckResultStr() string

VersionCheckResultStr returns string about command version check.

type Version

type Version struct {
	Current string
	Latest  string
}

func NewVersion

func NewVersion() *Version

Jump to

Keyboard shortcuts

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