Skip to content

Commit

Permalink
Defer close file handler (#1286)
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Aug 8, 2023
1 parent b4b2646 commit ad35327
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/debug/checkups/enroll-secret.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ func parseSecret(extraFH io.Writer, secretPath string) (Status, string) {
fmt.Fprintf(extraFH, "unknown error: %s\n", err)
return Erroring, fmt.Sprintf("unknown error: %s", err)
}
defer secretFH.Close()

// If we can read the secret, let's try to extract the munemo
tokenRaw, err := io.ReadAll(secretFH)
Expand Down

0 comments on commit ad35327

Please sign in to comment.