diff --git a/cmd/test/makefiles/makefiles.go b/cmd/test/makefiles/makefiles.go index ac8e2041d..26263e56a 100644 --- a/cmd/test/makefiles/makefiles.go +++ b/cmd/test/makefiles/makefiles.go @@ -88,7 +88,10 @@ var makefilesCmd = &cobra.Command{ totalBytes := int64(0) for i := 0; i < numberOfFiles; i++ { dir := dirs[randSource.Intn(len(dirs))] - size := randSource.Int63n(int64(maxFileSize-minFileSize)) + int64(minFileSize) + size := int64(minFileSize) + if maxFileSize > minFileSize { + size += randSource.Int63n(int64(maxFileSize - minFileSize)) + } writeFile(dir, fileName(), size) totalBytes += size } @@ -149,6 +152,9 @@ func commonInit() { default: source = randSource } + if minFileSize > maxFileSize { + maxFileSize = minFileSize + } } type zeroReader struct{}