mirror of https://github.com/docker/cli.git
Merge pull request #28925 from daehyeok/ineffassign
Refactoring ineffectual assignments
This commit is contained in:
commit
d9c0b0b8ef
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue