MCPcopy Create free account
hub / github.com/LanceLRQ/deer-executor / ObjectToJSONByte

Function ObjectToJSONByte

common/utils/json.go:24–30  ·  view source on GitHub ↗

ObjectToJSONByte 将对象转换成JSON字节数组

(obj interface{})

Source from the content-addressed store, hash-verified

22
23// ObjectToJSONByte 将对象转换成JSON字节数组
24func ObjectToJSONByte(obj interface{}) []byte {
25 b, err := json.Marshal(obj)
26 if err != nil {
27 return []byte("{}")
28 }
29 return b
30}
31
32// ObjectToJSONString 将对象转换成JSON字符串
33func ObjectToJSONString(obj interface{}) string {

Callers 2

PersistentJudgeResultFunction · 0.92
PackProblemsFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected