env

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package env provides a task for the Go toolchain `env` command. See `go help environment`, `go help env` and the `go` command documentations at https://pkg.go.dev/cmd/go#hdr-Print_Go_environment_information and https://pkg.go.dev/cmd/go#hdr-Environment_variables for more details.

References

(1) https://pkg.go.dev/cmd/go#hdr-Print_Go_environment_information
(2) https://pkg.go.dev/cmd/go#hdr-Environment_variables
(3) https://pkg.go.dev/cmd/go/internal/envcmd

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 WithEnvVars

func WithEnvVars(envVars ...string) Option

WithEnvVars sets the names of the target environment variables.

func WithExtraArgs

func WithExtraArgs(extraArgs ...string) Option

WithExtraArgs sets additional arguments to pass to the command.

type Options

type Options struct {
	// EnableJSONOutput indicates whether the output should be in JSON format.
	EnableJSONOutput bool

	// EnvVars are the names of the target environment variables.
	EnvVars []string
	// 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 `env` command. See `go help environment`, `go help env` and the `go` command documentations at https://pkg.go.dev/cmd/go#hdr-Print_Go_environment_information and https://pkg.go.dev/cmd/go#hdr-Environment_variables for more details.

References

(1) https://pkg.go.dev/cmd/go#hdr-Print_Go_environment_information
(2) https://pkg.go.dev/cmd/go#hdr-Environment_variables
(3) https://pkg.go.dev/cmd/go/internal/envcmd

func New

func New(opts ...Option) *Task

New creates a new task for the Go toolchain `env` command.

func (*Task) BuildParams

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

BuildParams builds the parameters.

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

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