Do not ignore errors in filepath.Walk
This fixes a linter issue but might have an impact on previous usage
because errors might have happened without the user noticing.
This change might be worth to mention in the next changelog.
@@ -238,7 +238,7 @@ func readDirectories(ctx context.Context, compress bool, directories ...director
dir := dir
eg.Go(func() error {
defer sem.Release(1)
- resources, err := readDirectory(ctx, p, compress, dir.prefix, dir.base, dir.path, dir.auth)
+ resources, err := readDirectory(ctx, compress, dir.prefix, dir.base, dir.path, dir.auth)
if err != nil {
return err
}
@@ -258,10 +258,10 @@ func readDirectories(ctx context.Context, compress bool, directories ...director
return result, eg.Wait()
}
-func readDirectory(ctx context.Context, progress *progress.Progress, compress bool, prefix, base, name string, auth Auth) ([]fleet.BundleResource, error) {
+func readDirectory(ctx context.Context, compress bool, prefix, base, name string, auth Auth) ([]fleet.BundleResource, error) {
var resources []fleet.BundleResource
- files, err := readContent(ctx, progress, base, name, auth)
+ files, err := readContent(ctx, base, name, auth)
if err != nil {
return nil, err
}
@@ -292,7 +292,7 @@ func readDirectory(ctx context.Context, progress *progress.Progress, compress bo
return resources, nil
}
-func readContent(ctx context.Context, progress *progress.Progress, base, name string, auth Auth) (map[string][]byte, error) {
+func readContent(ctx context.Context, base, name string, auth Auth) (map[string][]byte, error) {
temp, err := ioutil.TempDir("", "fleet")
if err != nil {
return nil, err
