arguments

package
v0.0.0-...-3a26ebd Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2019 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

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

Arguments provides an iterator to move through the arguments fetched in from os.Args

func New

func New() *Arguments

New instantiates a new Arguments pointer.

func NewArguments

func NewArguments(args []string) *Arguments

NewArguments builds an argument iterator from a collection of strings. Assumes that os.Args[1:] is to be passed into the constructor function.

func (*Arguments) Each

func (pointer *Arguments) Each(f func(i int, argument string)) *Arguments

Each method executes a provided function once for each argument.

func (*Arguments) Get

func (pointer *Arguments) Get(i int) (argument string)

Get safely accesses the argument at the iteration index.

func (*Arguments) Next

func (pointer *Arguments) Next() *Arguments

Next unshifts the first element of the Arguments struct and returns the modified struct.

func (*Arguments) String

func (pointer *Arguments) String() string

Jump to

Keyboard shortcuts

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