19 lines
360 B
Go
19 lines
360 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 ConvertResponseFromJSON(body io.ReadCloser, inter interface{}) {
|
|
json_err := json.NewDecoder(body).Decode(&inter)
|
|
_ = json_err //TODO work with errors
|
|
}
|