Attempt to unmarshal response
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 1m0s
All checks were successful
Create and publish a Docker image / build-and-push-image (push) Successful in 1m0s
This commit is contained in:
parent
e57d2d9d1d
commit
ba717cfdb6
13
main.go
13
main.go
@ -168,11 +168,14 @@ func main() {
|
||||
}
|
||||
|
||||
githubactions.Infof("Response: %v", string(resBody))
|
||||
d := json.NewDecoder(res.Body)
|
||||
for {
|
||||
var ipfsAddResponse []AddResponse
|
||||
json.Unmarshal(resBody, &ipfsAddResponse)
|
||||
if err != nil {
|
||||
githubactions.Fatalf(err.Error())
|
||||
if err := d.Decode(&ipfsAddResponse); err == io.EOF {
|
||||
break
|
||||
} else if err != nil {
|
||||
githubactions.Warningf("Failed to unmarshal response: %v", fmt.Errorf("%w", err))
|
||||
}
|
||||
githubactions.Infof("Received response: %v", ipfsAddResponse)
|
||||
}
|
||||
|
||||
githubactions.Infof("Response: %v", ipfsAddResponse)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user