mages

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetGoBinaryPath

func GetGoBinaryPath(binaryName string) (string, error)

GetGoBinaryPath looks for the given binary in path, if not checks if it's in $GOPATH/bin

func GetGoPath

func GetGoPath() string

GetGoPath returns the go path

func GetPackagePaths

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

GetPackagePaths gets the go paths for various checks

func GetPackagePathsWithExcludes

func GetPackagePathsWithExcludes(path string, excludes ...string) ([]string, error)

GetPackagePathsWithExcludes returns the package paths gotten by go list minus the dirs excluded

func GetProjectFileDirectories

func GetProjectFileDirectories(paths []string) ([]string, error)

GetProjectFileDirectories returns all the project directories excluding git and vendor

func GitHash

func GitHash(n int) string

GitHash returns the git hash for the current repo or "" if none.

func GitTag

func GitTag() string

GitTag returns the git tag for the current branch or "" if none.

func GoLdFlags

func GoLdFlags(domain string, data string) string

func GoLintExcludes

func GoLintExcludes() []string

GoLintExcludes returns commonly excluded dirs from quality checks

func IsPathExcluded

func IsPathExcluded(paths []string, path string) bool

IsPathExcluded determines if the provided path is excluded from common searches

Types

type Cmd

type Cmd struct {
	// contains filtered or unexported fields
}

Cmd represents a shell command

func NewCmd

func NewCmd(cmd string) *Cmd

NewCmd shell command from a string

func NewCmdf

func NewCmdf(cmdf string, args ...interface{}) *Cmd

NewCmdf creates a shell command from a format string

func (*Cmd) Output

func (c *Cmd) Output() (string, error)

Output runs the command and returns text from stdout

func (*Cmd) Run

func (c *Cmd) Run() error

Run runs shell command

func (*Cmd) RunWith

func (c *Cmd) RunWith(env map[string]string) error

RunWith runs shell command with environment variables

Jump to

Keyboard shortcuts

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