fix variables that werent being called
Signed-off-by: Jessica Frazelle <acidburn@docker.com>
This commit is contained in:
parent
9527d789e7
commit
b9fcb41e6d
9 changed files with 19 additions and 22 deletions
|
@ -168,6 +168,9 @@ func TestMoveToSubdir(t *testing.T) {
|
|||
}
|
||||
// validate that the files were moved to the subdirectory
|
||||
infos, err := ioutil.ReadDir(subDir)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if len(infos) != 4 {
|
||||
t.Fatalf("Should be four files in the subdir after the migration: actual length: %d", len(infos))
|
||||
}
|
||||
|
|
|
@ -5,17 +5,10 @@ package directory
|
|||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/docker/docker/pkg/longpath"
|
||||
)
|
||||
|
||||
// Size walks a directory tree and returns its total size in bytes.
|
||||
func Size(dir string) (size int64, err error) {
|
||||
fixedPath, err := filepath.Abs(dir)
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
fixedPath = longpath.AddPrefix(fixedPath)
|
||||
err = filepath.Walk(dir, func(d string, fileInfo os.FileInfo, e error) error {
|
||||
// Ignore directory sizes
|
||||
if fileInfo == nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue