buildutils

package
v0.5.8 Latest Latest
Warning

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

Go to latest
Published: May 12, 2022 License: Apache-2.0 Imports: 4 Imported by: 8

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
)

Functions

This section is empty.

Types

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.

func (*Builder) Build

func (b *Builder) Build(name, filename string) error

Build runs `go build` with the target output and name. If BuilderOptions.Tidy was set, it runs `go mod tidy` beforehand.

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.

Jump to

Keyboard shortcuts

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