Merge pull request #28925 from daehyeok/ineffassign

Refactoring ineffectual assignments
This commit is contained in:
Sebastiaan van Stijn 2017-01-18 15:01:57 +01:00 committed by GitHub
commit d9c0b0b8ef
2 changed files with 8 additions and 9 deletions

View File

@ -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 {

View File

@ -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