diff --git a/jsonUtils/jsonUtils.go b/jsonUtils/jsonUtils.go index c0387cb..4f0059e 100644 --- a/jsonUtils/jsonUtils.go +++ b/jsonUtils/jsonUtils.go @@ -1,9 +1,18 @@ package jsonutils -import "encoding/json" +//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 +}