Skip to content

Commit

Permalink
🔥 Remove useless functions
Browse files Browse the repository at this point in the history
  • Loading branch information
iyear committed Aug 22, 2021
1 parent 03409f8 commit 1000761
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions util/util.go
Expand Up @@ -3,32 +3,12 @@ package util
import (
"crypto/md5"
"encoding/hex"
"io/ioutil"
"net/url"
"os"
)

// Min true=>no error
func Min(x, y int) int {
if x < y {
return x
}
return y
}
func PathExists(path string) bool {
_, err := os.Stat(path)
if err == nil {
return true
}
if os.IsNotExist(err) {
return false
}
return false
}
func GetURLValue(Url, key string) string {
u, _ := url.Parse(Url)
query := u.Query()
//fmt.Println(query.Get(key))
return query.Get(key)
}

Expand All @@ -41,23 +21,3 @@ func GetMD5Encode(data string) string {
func Get16MD5Encode(data string) string {
return GetMD5Encode(data)[8:24]
}

// GetPathFiles only return file name
func GetPathFiles(path string) []string {
files, _ := ioutil.ReadDir(path)
var t []string
for _, file := range files {
if file.IsDir() {
continue
} else {
t = append(t, file.Name())
}
}
return t
}
func IF(f bool, a interface{}, b interface{}) interface{} {
if f {
return a
}
return b
}

0 comments on commit 1000761

Please sign in to comment.