Check the deferred Close calls so the linter is happy
errcheck flagged six naked defer Close() calls in the pack code and its
tests. Wrap them in the same defer func() { _ = x.Close() }() form the rest
of the tree already uses.
This commit is contained in:
+1
-1
@@ -37,7 +37,7 @@ func runOpen(ctx context.Context, path, addr string, openBrowser bool) error {
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot open %q: %w", path, err)
|
||||
}
|
||||
defer r.Close()
|
||||
defer func() { _ = r.Close() }()
|
||||
|
||||
ln, err := net.Listen("tcp", addr)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user