util

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CobraAddSubCommandInOrder added in v1.6.0

func CobraAddSubCommandInOrder(rootCommand *cobra.Command, subcommands ...*cobra.Command)

CobraAddSubCommandInOrder in the order of the subcommand provided.

func CobraCheckErrWithHelp added in v1.6.0

func CobraCheckErrWithHelp(cmd *cobra.Command, errMsg interface{})

CobraCheckErrWithHelp instead of cobra default behavior.

func CobraMarkHiddenGlobalFlags added in v1.6.0

func CobraMarkHiddenGlobalFlags(command *cobra.Command, flags ...string)

CobraMarkHiddenGlobalFlags that from params.

func CobraMarkHiddenGlobalFlagsExcept added in v1.6.0

func CobraMarkHiddenGlobalFlagsExcept(parentCommand *cobra.Command, unhiddenFlags ...string)

CobraMarkHiddenGlobalFlagsExcept the flags from params.

func DirExists added in v0.3.0

func DirExists(path string) bool

func FileExists added in v0.3.0

func FileExists(path string) bool

func IsDir added in v1.15.0

func IsDir(path string) bool

func IsInStringSlice added in v1.15.0

func IsInStringSlice(a string, list []string) bool

func LessContent added in v1.7.0

func LessContent(content string) error

LessContent is like shell command: echo "content" | less

func PrintErr added in v1.6.0

func PrintErr(msg interface{})

func PrintErrExit added in v1.15.0

func PrintErrExit(msg interface{})

func RemoveDuplStr added in v0.9.0

func RemoveDuplStr(strSlice []string) []string

RemoveDuplStr item from slice.

func Unzip added in v0.8.0

func Unzip(zipName, dstDir string) error

Unzip a zip file.

func Zip added in v0.8.0

func Zip(pathToZip, zipName string) error

Zip a dir or file.

Types

This section is empty.

Jump to

Keyboard shortcuts

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