Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // DefaultBuilder is the default Builder. DefaultBuilder = Builder{} // Build is an alias for DefaultBuilder.Build. Build = DefaultBuilder.Build )
View Source
var ForceRebuild = forceRebuild{}
ForceRebuild is an option to force rebuilding packages.
Functions ¶
This section is empty.
Types ¶
type BuildOption ¶
type BuildOption interface { // ApplyToBuild applies the option to the BuildOptions. ApplyToBuild(o *BuildOptions) }
BuildOption are options to apply to BuildOptions.
type BuildOptions ¶
type BuildOptions struct { // ForceRebuild forces rebuilding of packages that are already up-to-date. ForceRebuild bool // Mod specifies the module download mode to use. Mod *ModMode }
BuildOptions are options to supply for a Build.
func (*BuildOptions) ApplyOptions ¶
func (o *BuildOptions) ApplyOptions(opts []BuildOption)
ApplyOptions applies the slice of BuildOption to this BuildOptions.
func (*BuildOptions) ApplyToBuild ¶
func (o *BuildOptions) ApplyToBuild(o2 *BuildOptions)
ApplyToBuild implements BuildOption.
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder is a builder for go code.
func NewBuilder ¶
func NewBuilder(opts BuilderOptions) *Builder
NewBuilder creates a new Builder with the given options.
type BuilderOptions ¶
type BuilderOptions struct { // Dir is the working directory for the Builder. Dir string // Tidy can specify whether the builder should run `go mod tidy` before building. Tidy bool }
BuilderOptions are options to create a builder with.
type ModMode ¶
type ModMode string
ModMode is the module download mode to use.
const ( // ModModeVendor causes modules to be resolved from a vendor folder. ModModeVendor ModMode = "vendor" // ModModeReadonly expect all modules to be present in the module cache for the current module. ModModeReadonly ModMode = "readonly" // ModModeMod fetches any module before building. ModModeMod ModMode = "mod" )
func (ModMode) ApplyToBuild ¶
func (m ModMode) ApplyToBuild(o *BuildOptions)
ApplyToBuild implements BuildOption.
Click to show internal directories.
Click to hide internal directories.