1
This commit is contained in:
parent
80edf5bfe5
commit
1e70d9f893
21
strutils.go
21
strutils.go
@ -1,10 +1,13 @@
|
|||||||
package q5
|
package q5
|
||||||
|
|
||||||
import "io"
|
import (
|
||||||
import "strings"
|
"io"
|
||||||
import "crypto/md5"
|
"strings"
|
||||||
import "encoding/hex"
|
"crypto/md5"
|
||||||
import "hash/crc32"
|
"encoding/hex"
|
||||||
|
"encoding/json"
|
||||||
|
"hash/crc32"
|
||||||
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
JSON_NONE = 0
|
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