Documentation ¶
Index ¶
- Variables
- func Build(name, packageName, version string, opts ...BuildOption) func() error
- func CollectGoFiles() error
- func Format() error
- func FuzzBuild(name, packageName string) func() error
- func FuzzRun(name string) func() error
- func Generate(name, packageName string) func() error
- func Import() error
- func IntegrationTest(packageName string) func() error
- func License(basePath string) func() error
- func Lint(basePath string) func() error
- func Release(name, packageName, version string, opts ...BuildOption) func() error
- func UnitTest(packageName string) func() error
- func Vendor() error
- type BuildOption
Constants ¶
This section is empty.
Variables ¶
var AllCommandsPath = strings.Join([]string{".", "cmd", "..."}, PathSeparatorString)
AllCommandsPath denotes all Go application packages in this project.
var AllPackagesPath = strings.Join([]string{".", "..."}, PathSeparatorString)
AllPackagesPath denotes all Go packages in a project.
var CollectedGoFiles = make(map[string]bool)
CollectedGoFiles represents source and test Go files in a project. Populdated with CollectGoFiles().
var CollectedGoSourceFiles = make(map[string]bool)
CollectedGoSourceFiles represents the set of Go source files in a project. Populated with CollectGoFiles().
var CollectedGoTestFiles = make(map[string]bool)
CollectedGoTestFiles represents the set of Go test files in a project. Populdated with CollectGoFiles().
var GoListSourceFilesTemplate = "{{$p := .}}{{range $f := .GoFiles}}{{$p.Dir}}/{{$f}}\n{{end}}"
GoListSourceFilesTemplate provides a standard Go template for querying a project's Go source file paths.
var GoListTestFilesTemplate = "{{$p := .}}{{range $f := .XTestGoFiles}}{{$p.Dir}}/{{$f}}\n{{end}}"
GoListTestFilesTemplate provides a standard Go template for querying a project's Go test file paths.
var PathSeparatorString = string(os.PathSeparator)
PathSeparatorString models the os.PathSeparator as a string.
Functions ¶
func Build ¶
func Build(name, packageName, version string, opts ...BuildOption) func() error
Build the given binary using the given package.
func CollectGoFiles ¶
func CollectGoFiles() error
CollectGoFiles populates CollectedGoFiles, CollectedGoSourceFiles, and CollectedGoTestFiles.
Vendored files are ignored.
func IntegrationTest ¶
IntegrationTest run go test
func Release ¶
func Release(name, packageName, version string, opts ...BuildOption) func() error
Release build and generate a final release artifact.
Types ¶
type BuildOption ¶
type BuildOption func(*buildOpts)
BuildOption is used to define function option pattern.
func WithPIE ¶
func WithPIE() BuildOption
WithPIE enables Position Independent Executable compilation