diff --git a/command/container/stats_helpers.go b/command/container/stats_helpers.go index 4b57e3fe05..8eb7da0fd7 100644 --- a/command/container/stats_helpers.go +++ b/command/container/stats_helpers.go @@ -81,14 +81,11 @@ func collect(ctx context.Context, s *formatter.ContainerStats, cli client.APICli go func() { for { var ( - v *types.StatsJSON - memPercent = 0.0 - cpuPercent = 0.0 - blkRead, blkWrite uint64 // Only used on Linux - mem = 0.0 - memLimit = 0.0 - memPerc = 0.0 - pidsStatsCurrent uint64 + v *types.StatsJSON + memPercent, cpuPercent float64 + blkRead, blkWrite uint64 // Only used on Linux + mem, memLimit, memPerc float64 + pidsStatsCurrent uint64 ) if err := dec.Decode(&v); err != nil { diff --git a/command/plugin/create.go b/command/plugin/create.go index 2aab1e9e4a..82d17af48c 100644 --- a/command/plugin/create.go +++ b/command/plugin/create.go @@ -41,7 +41,9 @@ func validateConfig(path string) error { // validateContextDir validates the given dir and returns abs path on success. func validateContextDir(contextDir string) (string, error) { absContextDir, err := filepath.Abs(contextDir) - + if err != nil { + return "", err + } stat, err := os.Lstat(absContextDir) if err != nil { return "", err