standard

package
v0.7.11 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Standard package provides plugin that performs operations of the Go standard toolset. Things like compiling or running the base `go` prefixed commands.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrModuleNameNeeded   = errors.New("module name needed")
	ErrModuleNameNotFound = errors.New("module name not found")
	ErrFileMainNotExist   = errors.New("main.go file does not exist")
)

Functions

This section is empty.

Types

type Builder added in v0.4.0

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

func (*Builder) Build added in v0.4.0

func (g *Builder) Build(ctx context.Context, root string, args []string) error

Build runs the Go compiler to generate the desired binary. Assuming the Go executable installed and can be invoked with `go`.

func (*Builder) Flags added in v0.4.0

func (b *Builder) Flags() *pflag.FlagSet

ParseFlags

func (Builder) Name added in v0.4.0

func (b Builder) Name() string

func (*Builder) ParseFlags added in v0.4.0

func (b *Builder) ParseFlags(args []string)

ParseFlags

type Fixer

type Fixer struct{}

Fixer is in charge of performing a Fix operation that moves the main.go to cmd/[name-of-the-module]/main.go

func (Fixer) Fix

func (f Fixer) Fix(ctx context.Context, root string, args []string) error

Fix does the main.go magic - Determine if the file exists - Determine if there is a go.mod - Determine the name of the module (last part when slicing go.mod by /) - Create folder - Copy/move main.go to that folder

func (Fixer) Name

func (f Fixer) Name() string

type Initializer added in v0.5.1

type Initializer struct{}

func (*Initializer) AfterInitialize added in v0.5.1

func (i *Initializer) AfterInitialize(ctx context.Context, root string, args []string) error

- Initializes module based on args[0] - Creates cmd/name/main.go

func (*Initializer) Flags added in v0.5.1

func (i *Initializer) Flags(flags []string) *pflag.FlagSet

func (Initializer) Name added in v0.5.1

func (i Initializer) Name() string

func (*Initializer) ParseFlags added in v0.5.1

func (i *Initializer) ParseFlags(flags []string)

type Tester added in v0.4.0

type Tester struct{}

func (Tester) Name added in v0.4.0

func (t Tester) Name() string

func (*Tester) RunBeforeTest added in v0.4.0

func (b *Tester) RunBeforeTest(ctx context.Context, root string, args []string) error

func (*Tester) Test added in v0.4.0

func (p *Tester) Test(ctx context.Context, root string, args []string) error

Jump to

Keyboard shortcuts

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