util

package
v0.0.0-...-ea67977 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// InvalidArg error message format string for filling in the details of an invalid arg.
	InvalidArg = "invalid argument for %q: %q, should be a valid %v"
)

Variables

View Source
var (
	// ErrUnexpectedArgs indicates that the given number of arguments exceed the expected number of arguments.
	ErrUnexpectedArgs = errors.New("unexpected arguments")

	// ErrNotEnoughArgs indicates that the given number of arguments does not match the expected number of arguments.
	ErrNotEnoughArgs = errors.New("not enough arguments")
)

Functions

func ValidateArgCount

func ValidateArgCount(expectedArgNo, argNo int) error

ValidateArgCount validates the number of arguments and returns the corresponding error if there are any.

func ValidateArgs

func ValidateArgs(args []string, validations []validate.Argument) error

ValidateArgs validates arguments with the given validate.Argument functions. Two arguments must contain the same number of elements.

func ValidateTemplate

func ValidateTemplate(tmplPath string) (bool, error)

ValidateTemplate validates the template structure given the template path.

func ValidateVarArgs

func ValidateVarArgs(args []string, v validate.Argument) error

ValidateVarArgs validates variadic arguments with the given validate.Argument function.

Types

This section is empty.

Jump to

Keyboard shortcuts

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