install

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package install provides a task for the Go toolchain "install" command. It requires at least Go version 1.16 which comes with support to install commands via `go install` (1) without affecting the `main` module and will not "pollute" the `go.mod` file (2) anymore. See https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies for more details about the `go install` command.

References

(1) https://blog.golang.org/go116-module-changes#TOC_4.
(2) https://blog.golang.org/go116-module-changes#TOC_3.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Options)

Option is a task option.

func WithEnv

func WithEnv(env map[string]string) Option

WithEnv sets the task specific environment.

func WithModulePath

func WithModulePath(path string) Option

WithModulePath sets the module import path.

func WithModuleVersion

func WithModuleVersion(version *semver.Version) Option

WithModuleVersion sets the module version.

type Options

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

Options are task options.

func NewOptions

func NewOptions(opts ...Option) *Options

NewOptions creates new task options.

type Task

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

Task is a task for the Go toolchain "install" command. It requires at least Go version 1.16 which comes with support to install commands via `go install` (1) without affecting the `main` module and will not "pollute" the `go.mod` file (2) anymore. See https://pkg.go.dev/cmd/go#hdr-Compile_and_install_packages_and_dependencies for more details about the `go install` command.

References

(1) https://blog.golang.org/go116-module-changes#TOC_4.
(2) https://blog.golang.org/go116-module-changes#TOC_3.

func New

func New(opts ...Option) *Task

New creates a new task for the Go toolchain "install" command.

func (*Task) BuildParams

func (t *Task) BuildParams() []string

BuildParams builds the parameters. Note that configured flags are applied after the "GOFLAGS" environment variable and could overwrite already defined flags.

See `go help environment`, `go help env` and the `go` command documentations for more details: https://golang.org/cmd/go/#hdr-Environment_variables

func (*Task) Env

func (t *Task) Env() map[string]string

Env returns the task specific environment.

func (*Task) Kind

func (t *Task) Kind() task.Kind

Kind returns the task kind.

func (*Task) Name added in v0.6.0

func (t *Task) Name() string

Name returns the task name.

func (*Task) Options

func (t *Task) Options() task.Options

Options returns the task options.

Jump to

Keyboard shortcuts

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