diff --git a/internal/common/distribution.go b/internal/common/distribution.go index ef0cc1661..2ee306dd3 100644 --- a/internal/common/distribution.go +++ b/internal/common/distribution.go @@ -67,7 +67,9 @@ func ReadDistributions(distsDir, distro string) ([]DistributionFile, error) { if err != nil { return err } - defer func() { // #nosec G307 https://github.com/securego/gosec/issues/714 + // nosec because of https://github.com/securego/gosec/issues/714 + /* #nosec G307 */ + defer func() { err := f.Close() if err != nil { fmt.Printf("Error closing file: %v", err) @@ -142,7 +144,9 @@ func FindPackages(distsDir, distro, arch, search string) ([]Package, error) { if err != nil { return nil, err } - defer func() { // #nosec G307 https://github.com/securego/gosec/issues/714 + // nosec because of https://github.com/securego/gosec/issues/714 + /* #nosec G307 */ + defer func() { err := f.Close() if err != nil { fmt.Printf("Error closing file: %v", err)