Skip to content

Commit 8ea03a9

Browse files
authored
move CloseTokenSource call out of defer (#3796)
1 parent d2f1c9c commit 8ea03a9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

main.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ import (
1010
)
1111

1212
func main() {
13-
defer config.CloseTokenSource() // Revoke SA token when the plugin is exiting because Terraform command finished.
14-
1513
var debugMode bool
1614
flag.BoolVar(&debugMode, "debug", false, "set to true to run the provider with support for debuggers like delve")
1715
flag.Parse()
@@ -25,7 +23,8 @@ func main() {
2523
provider.MuxProviderFactory(),
2624
serveOpts...,
2725
)
26+
config.CloseTokenSource() // Revoke SA token when the plugin is exiting because Terraform command finished.
2827
if err != nil {
29-
log.Println(err)
28+
log.Fatal(err)
3029
}
3130
}

0 commit comments

Comments
 (0)