flag

package
v0.0.0-...-e1e9d1d Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package flag defines the standard interface for command-line flag parsing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockParser

type MockParser struct {
	ParseFunc func([]string, interface{}) error
}

MockParser is a test mock for the Parser interface.

func (*MockParser) Parse

func (m *MockParser) Parse(args []string, v interface{}) error

type Parser

type Parser interface {
	// Parse parses the command-line arguments provided by args into v, which
	// typically should be a pointer to a struct, but the exact behaviour is
	// implementation-specific.  The args slice should have the program name
	// in position 0, as is the case when read from os.Args.
	Parse(args []string, v interface{}) error
}

Parser defines the method to implement to parse command-line arguments.

Jump to

Keyboard shortcuts

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