Skip to content

Commit

Permalink
fix: errcheck for parsing CLI flags
Browse files Browse the repository at this point in the history
  • Loading branch information
thevilledev committed Oct 11, 2024
1 parent ba07461 commit fb0a3a5
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cmd/vault-plugin-auth-gcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import (
func main() {
apiClientMeta := &api.PluginAPIClientMeta{}
flags := apiClientMeta.FlagSet()
flags.Parse(os.Args[1:])

if err := flags.Parse(os.Args[1:]); err != nil {
fatal(err)
}

tlsConfig := apiClientMeta.GetTLSConfig()
tlsProviderFunc := api.VaultPluginTLSProvider(tlsConfig)
Expand All @@ -27,7 +30,11 @@ func main() {
TLSProviderFunc: tlsProviderFunc,
})
if err != nil {
log.Println(err)
os.Exit(1)
fatal(err)
}
}

func fatal(err error) {
log.Println(err)
os.Exit(1)
}

0 comments on commit fb0a3a5

Please sign in to comment.