Bump github.com/gookit/config/v2 from 2.1.8 to 2.2.2

Bumps [github.com/gookit/config/v2](https://github.com/gookit/config) from 2.1.8 to 2.2.2.
- [Release notes](https://github.com/gookit/config/releases)
- [Commits](https://github.com/gookit/config/compare/v2.1.8...v2.2.2)

---
updated-dependencies:
- dependency-name: github.com/gookit/config/v2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
This commit is contained in:
dependabot[bot]
2023-06-13 10:54:58 +02:00
committed by Ralf Haferkamp
parent 03045c5ccc
commit 5ebc596352
190 changed files with 18970 additions and 4167 deletions
-25
View File
@@ -2,11 +2,8 @@ package strutil
import (
"bytes"
"crypto/md5"
"encoding/base32"
"encoding/base64"
"encoding/hex"
"fmt"
"net/url"
"strings"
"text/template"
@@ -73,28 +70,6 @@ func StripSlashes(s string) string {
// -------------------- encode --------------------
//
// Md5 Generate a 32-bit md5 string
func Md5(src any) string {
return hex.EncodeToString(Md5Bytes(src))
}
// MD5 Generate a 32-bit md5 string
func MD5(src any) string { return Md5(src) }
// GenMd5 Generate a 32-bit md5 string
func GenMd5(src any) string { return Md5(src) }
// Md5Bytes Generate a 32-bit md5 bytes
func Md5Bytes(src any) []byte {
h := md5.New()
if s, ok := src.(string); ok {
h.Write([]byte(s))
} else {
h.Write([]byte(fmt.Sprint(src)))
}
return h.Sum(nil)
}
// URLEncode encode url string.
func URLEncode(s string) string {
if pos := strings.IndexRune(s, '?'); pos > -1 { // escape query data