sanity

package
v0.0.0-...-1ae188b Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// AllCmdChecks is the list of CmdCheck type functions
	AllCmdChecks = []CmdCheck{
		CheckLongDesc,
		CheckExamples,
		CheckFlags,
	}

	// AllGlobalChecks is the list of GlobalCheck type functions
	AllGlobalChecks = []GlobalCheck{
		CheckGlobalVarFlags,
	}
)

Functions

func CheckExamples

func CheckExamples(cmd *cobra.Command) []error

CheckExamples checks if the command examples are valid

func CheckFlags

func CheckFlags(cmd *cobra.Command) []error

CheckFlags checks if the command-line flags are valid

func CheckGlobalVarFlags

func CheckGlobalVarFlags() []error

CheckGlobalVarFlags checks if the global flags are valid

func CheckLongDesc

func CheckLongDesc(cmd *cobra.Command) []error

CheckLongDesc checks if the long description is valid

func RunCmdChecks

func RunCmdChecks(cmd *cobra.Command, cmdChecks []CmdCheck, skipCmd []string) []error

RunCmdChecks runs all the CmdCheck functions passed, skipping skippable commands and looks for error

func RunGlobalChecks

func RunGlobalChecks(globalChecks []GlobalCheck) []error

RunGlobalChecks runs all the GlobalCheck functions passed and checks for error

Types

type CmdCheck

type CmdCheck func(cmd *cobra.Command) []error

CmdCheck is the commom type of functions to check cobra commands

type GlobalCheck

type GlobalCheck func() []error

GlobalCheck is the common type of functions to check global flags

Jump to

Keyboard shortcuts

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