Minor Go-style suggeston: move decode and error assignment into if clause check.

This commit is contained in:
Satnam Singh 2014-09-22 15:20:14 -07:00
parent eb54622568
commit 87768a047c

View File

@ -172,8 +172,7 @@ func getContainerInfoRequest(body io.ReadCloser) (*info.ContainerInfoRequest, er
query.NumStats = 64
decoder := json.NewDecoder(body)
err := decoder.Decode(&query)
if err != nil && err != io.EOF {
if err := decoder.Decode(&query); err != nil && err != io.EOF {
return nil, fmt.Errorf("unable to decode the json value: %s", err)
}