mirror of
https://github.com/golang/go
synced 2024-11-19 13:54:56 -07:00
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 <tobias.klauser@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
709317138f
commit
ad466d8b87
@ -133,9 +133,7 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func
|
||||
}()
|
||||
rc = f
|
||||
}
|
||||
defer func() {
|
||||
rc.Close()
|
||||
}()
|
||||
defer rc.Close()
|
||||
|
||||
var hdr string
|
||||
buf := bufio.NewReader(rc)
|
||||
|
Loading…
Reference in New Issue
Block a user