19 lines
352 B
Go
19 lines
352 B
Go
package jsonutils
|
|
|
|
//TODO: Rename package
|
|
import (
|
|
"encoding/json"
|
|
"io"
|
|
)
|
|
|
|
func ConvertToJSON(g interface{}) []byte {
|
|
g_json, err := json.Marshal(g)
|
|
_ = err //TODO: Check Errors
|
|
return g_json
|
|
}
|
|
|
|
func ConvertFromJSON(body io.ReadCloser, inter interface{}) {
|
|
json_err := json.NewDecoder(body).Decode(&inter)
|
|
_ = json_err //TODO work with errors
|
|
}
|