Skip to content

Commit ad466d8

Browse files
committed
go/internal/gcimporter: simplify defer
Directly use rc.Close instead of wrapping it with a closure. Change-Id: I3dc1c21ccbfe031c230b035126d5ea3bc62055c3 Reviewed-on: https://go-review.googlesource.com/99716 Run-TryBot: Tobias Klauser <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent 7093171 commit ad466d8

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/go/internal/gcimporter/gcimporter.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func
133133
}()
134134
rc = f
135135
}
136-
defer func() {
137-
rc.Close()
138-
}()
136+
defer rc.Close()
139137

140138
var hdr string
141139
buf := bufio.NewReader(rc)

0 commit comments

Comments
 (0)