Documentation
¶
Index ¶
- Variables
- func BubbleSort(slice []int) []int
- func Checksum(mode string, file string) string
- func IPGet() map[string]string
- func IsFlagPassed(name string) bool
- func ListSearchFirstElement(source *list.List, target string) *list.Element
- func MatchFilter(filter []string, s string) bool
- func MatchString(pattern string, s string) bool
- func PathCreate(path string) bool
- func PathExecFile() (string, error)
- func PathExist(path string) bool
- func PathWalk(path string, listPointer interface{}, filter []string, subFolder bool) error
- func ProgramExist(programName string, programPath ...interface{}) (bool, string, error)
- func ProgramRealtimeOutput(cmd *exec.Cmd) error
- func QuickSort(arr []int) []int
- func SelectionSort(slice []int) []int
- func ShowArgs()
- func SliceClear(s *[]interface{})
- func SliceDelete(slice *[]string, index int) error
- func StringFindInSlice(slice []string, str string) int
- func StringTrimSuffix(file string) string
- func Unzip(archive, target string) error
- func Zipit(source, target string) error
- type Err
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
// OriginalWorkingPath Original Working Path
OriginalWorkingPath, _ = os.Getwd()
)
Functions ¶
func IPGet ¶
IPGet Get the IP address of the physical network adapter, ignore the virtual machine network adapter
func ListSearchFirstElement ¶
ListSearchFirstElement Search for the first matching element in the list
func PathExecFile ¶
PathExecFile Return the program running path and error output
func ProgramExist ¶
ProgramExist Check if the program exists in environment variable or input path
func ProgramRealtimeOutput ¶
ProgramRealtimeOutput Execute commands and get real-time output
func StringFindInSlice ¶
StringFindInSlice find string's position in a slice
Types ¶
type Err ¶
Err 包含错误代码与错误信息的结构体
func (*Err) Error ¶
Error 将Err结构体转换为string输出
Example ¶
var err Err err.New(404, "can't found") fmt.Print(err.Error())
Output: code: 404 msg: can't found
Click to show internal directories.
Click to hide internal directories.