Commit 8b5f72c0 authored by Vladimir Barsukov's avatar Vladimir Barsukov
Browse files

GetJson

parent 5528fd07
......@@ -57,7 +57,7 @@ func (c *ZClient) GetEmpty(url string) error {
return fmt.Errorf("status code: %v", resp.StatusCode)
}
func (c *ZClient) GetJSON(target any, url string) error {
func (c *ZClient) GetJson(target any, url string) error {
var err error
var resp *http.Response
......@@ -68,3 +68,7 @@ func (c *ZClient) GetJSON(target any, url string) error {
return json.NewDecoder(resp.Body).Decode(&target)
}
func GetJson(target any, url string) error {
return Default().GetJson(target, url)
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment