util

package
v0.0.0-...-5dcfad9 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckErr

func CheckErr(msg interface{})

CheckErr and exit.

func CobraAddSubCommandInOrder

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

CobraAddSubCommandInOrder in the order of the subcommand provided.

func CobraCheckErrWithHelp

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

CobraCheckErrWithHelp instead of cobra default behavior.

func CobraMarkHiddenGlobalFlags

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

CobraMarkHiddenGlobalFlags that from params.

func CobraMarkHiddenGlobalFlagsExcept

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

CobraMarkHiddenGlobalFlagsExcept the flags from params.

func DirExists

func DirExists(path string) bool

DirExists ...

func FileExists

func FileExists(path string) bool

FileExists ...

func LessContent

func LessContent(content string) error

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

func PrintErr

func PrintErr(msg interface{})

PrintErr with red color if err not nil.

func RemoveDuplStr

func RemoveDuplStr(strSlice []string) []string

RemoveDuplStr item from slice.

func Unzip

func Unzip(zipName, dstDir string) error

Unzip a zip file.

func Zip

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