Skip to content

Commit f517e5f

Browse files
authored
fix(enterprise/cli): add missing defer close of closer funcs (#15986)
1 parent 23b1c2d commit f517e5f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

enterprise/cli/proxyserver.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ import (
3434
"github.com/coder/serpent"
3535
)
3636

37-
type closers []func()
37+
type closerFuncs []func()
3838

39-
func (c closers) Close() {
39+
func (c closerFuncs) Close() {
4040
for _, closeF := range c {
4141
closeF()
4242
}
4343
}
4444

45-
func (c *closers) Add(f func()) {
45+
func (c *closerFuncs) Add(f func()) {
4646
*c = append(*c, f)
4747
}
4848

@@ -113,7 +113,8 @@ func (r *RootCmd) proxyServer() *serpent.Command {
113113
serpent.RequireNArgs(0),
114114
),
115115
Handler: func(inv *serpent.Invocation) error {
116-
var closers closers
116+
var closers closerFuncs
117+
defer closers.Close()
117118
// Main command context for managing cancellation of running
118119
// services.
119120
ctx, topCancel := context.WithCancel(inv.Context())

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy