1
This commit is contained in:
parent
80edf5bfe5
commit
1e70d9f893
21
strutils.go
21
strutils.go
@ -1,10 +1,13 @@
|
||||
package q5
|
||||
|
||||
import "io"
|
||||
import "strings"
|
||||
import "crypto/md5"
|
||||
import "encoding/hex"
|
||||
import "hash/crc32"
|
||||
import (
|
||||
"io"
|
||||
"strings"
|
||||
"crypto/md5"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"hash/crc32"
|
||||
)
|
||||
|
||||
const (
|
||||
JSON_NONE = 0
|
||||
@ -45,3 +48,11 @@ func JsonStrType(data string) int32 {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func EncodeJson(p interface{}) string {
|
||||
if jsonBytes, err := json.Marshal(p); err == nil {
|
||||
return string(jsonBytes)
|
||||
} else {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user