fix: replace panic with os.Exit in Execute function for better error handling (#3702)

mine
Ümüt Özalp 2025-12-13 19:41:06 +01:00 committed by GitHub
parent d8b4b6b62a
commit d21f6cd2bc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

@ -69,9 +69,7 @@ func init() {
// Execute root command.
func Execute() {
if err := rootCmd.Execute(); err != nil {
if !errors.As(err, &flagError{}) {
panic(err)
}
os.Exit(1)
}
}