rm risky panics

This commit is contained in:
Denis Bilenko 2024-12-09 14:22:25 +01:00
parent 8e77be3a9e
commit 207c5fd02a
2 changed files with 3 additions and 6 deletions

View File

@ -21,9 +21,8 @@ func initOutputFlag(cmd *cobra.Command) *outputFlag {
// Configure defaults from environment, if applicable.
// If the provided value is invalid it is ignored.
if v, ok := env.Lookup(cmd.Context(), envOutputFormat); ok {
if err := f.output.Set(v); err != nil {
panic(err)
}
// QQQ log the error?
_ = f.output.Set(v)
}
cmd.PersistentFlags().VarP(&f.output, "output", "o", "output type: text or json")

View File

@ -54,9 +54,7 @@ func newCallback(ctx context.Context, a *PersistentAuth) (*callbackServer, error
}
cb.srv.Handler = cb
go func() {
if err := cb.srv.Serve(cb.ln); err != http.ErrServerClosed {
panic(err)
}
_ = cb.srv.Serve(cb.ln)
}()
return cb, nil
}