Skip to content

Commit

Permalink
Command results reader close err is ignored (#2282)
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi authored Oct 24, 2023
1 parent 3ad6e0c commit efae903
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions access_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,9 @@ const (
)

var atcTestCases = []struct {
name string
args []string
shouldExpire bool
name string
args []string
shouldExpire bool
// The expected expiry or -1 if we use the default expiry value
expectedExpiry int
expectedScope string
Expand Down
7 changes: 2 additions & 5 deletions utils/cliutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -776,12 +776,9 @@ func isEnvFailNoOp() bool {
return strings.ToLower(os.Getenv(coreutils.FailNoOp)) == "true"
}

func CleanupResult(result *commandUtils.Result, originError *error) {
func CleanupResult(result *commandUtils.Result, err *error) {
if result != nil && result.Reader() != nil {
e := result.Reader().Close()
if originError == nil {
*originError = e
}
*err = errors.Join(*err, result.Reader().Close())
}
}

Expand Down

0 comments on commit efae903

Please sign in to comment.