gtz

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	GoToolGoCov       = NewGoTool("github.com/axw/gocov", "gocov", "v1.2.1")
	GoToolGoCovHTML   = NewGoTool("github.com/matm/gocov-html", "cmd/gocov-html", "v1.4.0")
	GoToolGolint      = NewGoTool("golang.org/x/lint", "golint", "v0.0.0-20210508222113-6edffad5e616")
	GoToolMockGen     = NewGoTool("go.uber.org/mock", "/mockgen", "v0.5.0")
	GoToolStaticCheck = NewGoTool("honnef.co/go/tools", "cmd/staticcheck", "2024.1.1")
)

Known Go tools.

Functions

func MustRunGoChecks

func MustRunGoChecks(params *GoChecksParams)

MustRunGoChecks runs a set of Go checks in the current working directory.

func MustRunGoTests

func MustRunGoTests(params *GoTestsParams)

MustRunGoTests runs a set of Go tests in the current working directory.

Types

type GoChecksParams

type GoChecksParams struct {
	AllPackages []string
	BuildTags   []string
}

GoChecksParams describes the parameters for running Go checks.

type GoTestsParams

type GoTestsParams struct {
	AllPackages      []string
	SelectedPackages []string
	BuildTags        []string
	TestRegexp       string
	IgnoreCache      bool
	Verbose          *bool
	CoverageDirPath  string
	OpenCoverage     bool
}

GoTestsParams describes the parameters for running Go tests.

type GoTool

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

GoTool describes a Go tool.

func MustLookupGoTool

func MustLookupGoTool(key string) *GoTool

MustLookupGoTool returns a *GoTool

func NewGoTool

func NewGoTool(pkg, path, defaultVersion string) *GoTool

NewGoTool initializes a new Go tool.

func (*GoTool) GetArgument

func (t *GoTool) GetArgument() string

GetArgument returns an argument string suitable for Go run.

func (*GoTool) GetCommand

func (t *GoTool) GetCommand() *shellz.Command

GetCommand returns a *shellz.Command for this Go tool.

func (*GoTool) GetPackage

func (t *GoTool) GetPackage() string

GetPackage returns the Go package.

func (*GoTool) GetVersion

func (t *GoTool) GetVersion() string

GetVersion returns the current Go tool defaultVersion (either pinned, or from go.mod).

func (*GoTool) MustRun

func (t *GoTool) MustRun(params ...string)

MustRun runs the Go tool.

Jump to

Keyboard shortcuts

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