【升级go 1.18】

This commit is contained in:
PandaGoAdmin
2022-07-13 11:54:54 +08:00
parent 2e18999587
commit 433ee08634
60 changed files with 253 additions and 248 deletions

View File

@@ -51,7 +51,7 @@ func Contains(haystack, needle string, startOffset ...int) int {
}
// 字符串模板解析
func TemplateResolve(temp string, data interface{}) string {
func TemplateResolve(temp string, data any) string {
t, _ := template.New("string-temp").Parse(temp)
var tmplBytes bytes.Buffer
@@ -62,7 +62,7 @@ func TemplateResolve(temp string, data interface{}) string {
return tmplBytes.String()
}
func ReverStrTemplate(temp, str string, res map[string]interface{}) {
func ReverStrTemplate(temp, str string, res map[string]any) {
index := UnicodeIndex(temp, "{")
ei := UnicodeIndex(temp, "}") + 1
next := kgo.KStr.Trim(temp[ei:], " ")