mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-05 12:41:32 +02:00
don't use ReadAll when decoding JSON
An empty stream isn't valid JSON, so we shouldn't silently ignore it.
This commit is contained in:
+3
-1
@@ -1,6 +1,8 @@
|
||||
package jira
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"gopkg.in/Netflix-Skunkworks/go-jira.v1/jiradata"
|
||||
)
|
||||
|
||||
@@ -19,7 +21,7 @@ func GetProjectComponents(ua HttpClient, endpoint string, project string) (*jira
|
||||
|
||||
if resp.StatusCode == 200 {
|
||||
results := jiradata.Components{}
|
||||
return &results, readJSON(resp.Body, &results)
|
||||
return &results, json.NewDecoder(resp.Body).Decode(&results)
|
||||
}
|
||||
return nil, responseError(resp)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user