fix: close sessionPolicyFile in the sts-assume-role example (#19428)

This commit is contained in:
guangwu 2024-04-13 00:09:55 +08:00 committed by GitHub
parent d3a07c29ba
commit 87299eba10
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 0 deletions

View File

@ -85,6 +85,7 @@ func main() {
if f, err := os.Open(sessionPolicyFile); err != nil {
log.Fatalf("Unable to open session policy file: %v", err)
} else {
defer f.Close()
bs, err := io.ReadAll(f)
if err != nil {
log.Fatalf("Error reading session policy file: %v", err)