From 06880e9f728728ed4ab1b35b055d230c0e823dbd Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Thu, 9 May 2024 13:24:10 +0800 Subject: [PATCH] 1 --- strutils.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/strutils.go b/strutils.go index 63d7427..07ed35a 100644 --- a/strutils.go +++ b/strutils.go @@ -69,6 +69,11 @@ func EncodeJson(p interface{}) string { } } +func DecodeJson(data string, p interface{}) error { + err := json.Unmarshal([]byte(data), &p) + return err +} + func StrSplit(s string, sep string) []string { return strings.Split(s, sep) }