metropolis/pkg/supervisor: define WithPropagatePanic as func not var
This is just to keep the code style in line, no real behaviour change.
Change-Id: Ica5aa2119e248681d2fff951820e9bc77c77a23d
Reviewed-on: https://review.monogon.dev/c/monogon/+/2928
Tested-by: Jenkins CI
Reviewed-by: Serge Bazanski <serge@monogon.tech>
diff --git a/metropolis/pkg/supervisor/supervisor.go b/metropolis/pkg/supervisor/supervisor.go
index 9865279..2af5e67 100644
--- a/metropolis/pkg/supervisor/supervisor.go
+++ b/metropolis/pkg/supervisor/supervisor.go
@@ -107,14 +107,12 @@
// SupervisorOpt are runtime configurable options for the supervisor.
type SupervisorOpt func(s *supervisor)
-var (
- // WithPropagatePanic prevents the Supervisor from catching panics in
- // runnables and treating them as failures. This is useful to enable for
- // testing and local debugging.
- WithPropagatePanic = func(s *supervisor) {
- s.propagatePanic = true
- }
-)
+// WithPropagatePanic prevents the Supervisor from catching panics in
+// runnables and treating them as failures. This is useful to enable for
+// testing and local debugging.
+func WithPropagatePanic(s *supervisor) {
+ s.propagatePanic = true
+}
func WithExistingLogtree(lt *logtree.LogTree) SupervisorOpt {
return func(s *supervisor) {