1
0
mirror of https://github.com/docker/cli.git synced 2026-01-18 08:21:31 +03:00

Merge pull request #12365 from HuKeping/list

Use local variable err instead of a outer one
Upstream-commit: 392fd243bc8c9762aa9e559a67f2410ae3820ee8
Component: engine
This commit is contained in:
Brian Goff
2015-04-14 12:49:15 -04:00

View File

@@ -506,8 +506,7 @@ func getContainersTop(eng *engine.Engine, version version.Version, w http.Respon
}
func getContainersJSON(eng *engine.Engine, version version.Version, w http.ResponseWriter, r *http.Request, vars map[string]string) error {
var err error
if err = parseForm(r); err != nil {
if err := parseForm(r); err != nil {
return err
}
@@ -520,10 +519,11 @@ func getContainersJSON(eng *engine.Engine, version version.Version, w http.Respo
}
if tmpLimit := r.Form.Get("limit"); tmpLimit != "" {
config.Limit, err = strconv.Atoi(tmpLimit)
limit, err := strconv.Atoi(tmpLimit)
if err != nil {
return err
}
config.Limit = limit
}
containers, err := getDaemon(eng).Containers(config)