Skip to content

Commit c5e91f4

Browse files
committed
nolint
1 parent 5efcf7b commit c5e91f4

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

graceful.go

+5-3
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ func GracefulSignals(signals ...os.Signal) Option {
4444

4545
// GracefulShutdownTimeout sets timeout for shutdown. Default is 0.
4646
func GracefulShutdownTimeout(timeout time.Duration) Option {
47-
return func(o *gracefulOpts) { o.ShutdownTimeout = timeout }
47+
return func(o *gracefulOpts) {
48+
o.ShutdownTimeout = timeout
49+
}
4850
}
4951

5052
// Graceful runs all servers contained in `s`, then waits signals.
@@ -58,7 +60,7 @@ func (s Servers) Graceful(ctx context.Context, options ...Option) error {
5860
ctx, stop := signal.NotifyContext(ctx, opts.Signals...)
5961
defer stop()
6062

61-
ctx, cancel := context.WithCancelCause(ctx)
63+
ctx, cancel := context.WithCancelCause(ctx) // nolint:govet
6264

6365
for _, srv := range s.Servers {
6466
go func(ctx context.Context, srv Server) {
@@ -72,7 +74,7 @@ func (s Servers) Graceful(ctx context.Context, options ...Option) error {
7274

7375
<-ctx.Done()
7476
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
7678
}
7779

7880
ctx, cancelT := context.WithTimeout(context.Background(), opts.ShutdownTimeout)

0 commit comments

Comments
 (0)