@@ -44,7 +44,9 @@ func GracefulSignals(signals ...os.Signal) Option {
44
44
45
45
// GracefulShutdownTimeout sets timeout for shutdown. Default is 0.
46
46
func GracefulShutdownTimeout (timeout time.Duration ) Option {
47
- return func (o * gracefulOpts ) { o .ShutdownTimeout = timeout }
47
+ return func (o * gracefulOpts ) {
48
+ o .ShutdownTimeout = timeout
49
+ }
48
50
}
49
51
50
52
// Graceful runs all servers contained in `s`, then waits signals.
@@ -58,7 +60,7 @@ func (s Servers) Graceful(ctx context.Context, options ...Option) error {
58
60
ctx , stop := signal .NotifyContext (ctx , opts .Signals ... )
59
61
defer stop ()
60
62
61
- ctx , cancel := context .WithCancelCause (ctx )
63
+ ctx , cancel := context .WithCancelCause (ctx ) // nolint:govet
62
64
63
65
for _ , srv := range s .Servers {
64
66
go func (ctx context.Context , srv Server ) {
@@ -72,7 +74,7 @@ func (s Servers) Graceful(ctx context.Context, options ...Option) error {
72
74
73
75
<- ctx .Done ()
74
76
if err := context .Cause (ctx ); err != nil && ! errors .Is (err , context .Canceled ) {
75
- return errors .Join (errors .New ("failed to start servers" ), err )
77
+ return errors .Join (errors .New ("failed to start servers" ), err ) // nolint:govet
76
78
}
77
79
78
80
ctx , cancelT := context .WithTimeout (context .Background (), opts .ShutdownTimeout )
0 commit comments