sharedutils/jsonUtils/jsonUtils.go
2022-11-02 13:30:27 +03:00

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
}