mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-30 18:00:56 +01:00
feat: added modules
This commit is contained in:
12
core/utils/json.go
Normal file
12
core/utils/json.go
Normal file
@@ -0,0 +1,12 @@
|
||||
package utils
|
||||
|
||||
import "encoding/json"
|
||||
|
||||
func JsonToBytes(d interface{}) (bytes []byte, err error) {
|
||||
switch d.(type) {
|
||||
case []byte:
|
||||
return d.([]byte), nil
|
||||
default:
|
||||
return json.Marshal(d)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user