standard

package
v0.13.5 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2023 License: MIT Imports: 18 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 AfterInitializer

type AfterInitializer struct{}

func (*AfterInitializer) AfterInitialize

func (i *AfterInitializer) AfterInitialize(ctx context.Context, options new.Options) error

Initialize the go module

func (AfterInitializer) Name

func (i AfterInitializer) Name() string

type Builder

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

func (*Builder) Build

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

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

ParseFlags

func (Builder) Name

func (b Builder) Name() string

func (*Builder) ParseFlags

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 GetBuffalo added in v0.11.4

type GetBuffalo struct{}

func (GetBuffalo) AfterInitialize added in v0.11.4

func (gag GetBuffalo) AfterInitialize(ctx context.Context, options new.Options) error

Getting correct Buffalo version.

func (GetBuffalo) Name added in v0.11.4

func (gag GetBuffalo) Name() string

type GoImportsFixer added in v0.12.0

type GoImportsFixer struct{}

GoImportsFixer runs goimports for the given root directory.

func (GoImportsFixer) Fix added in v0.12.0

func (ef GoImportsFixer) Fix(ctx context.Context, root string, args []string) error

func (GoImportsFixer) Name added in v0.12.0

func (ef GoImportsFixer) Name() string

type GoModTidyFixer added in v0.12.0

type GoModTidyFixer struct{}

GoModTidyFixer is a fixer that runs `go mod tidy`.

func (GoModTidyFixer) Fix added in v0.12.0

func (ef GoModTidyFixer) Fix(ctx context.Context, root string, args []string) error

func (GoModTidyFixer) Name added in v0.12.0

func (ef GoModTidyFixer) Name() string

type Initializer

type Initializer struct{}

func (*Initializer) Initialize

func (i *Initializer) Initialize(ctx context.Context, options new.Options) error

Initialize the go module

func (Initializer) Name

func (i Initializer) Name() string

type ModTidy added in v0.11.4

type ModTidy struct{}

func (ModTidy) AfterInitialize added in v0.11.4

func (gag ModTidy) AfterInitialize(ctx context.Context, options new.Options) error

func (ModTidy) Name added in v0.11.4

func (gag ModTidy) Name() string

type Tester

type Tester struct{}

func (Tester) Name

func (t Tester) Name() string

func (*Tester) RunBeforeTest

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

func (*Tester) Test

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