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:
Duc-Tam Nguyen
2026-06-15 00:02:48 +07:00
parent 5b4b523419
commit e126968c65
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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 {