diff options
author | Tobias Klauser <tklauser@distanz.ch> | 2018-03-09 11:35:18 +0100 |
---|---|---|
committer | Tobias Klauser <tobias.klauser@gmail.com> | 2018-03-09 15:00:06 +0000 |
commit | ad466d8b87da200fa682f59eca79665addf75138 (patch) | |
tree | 8e4f77af3c2c01aac0f7bbf4d2468b6f980cd37d /src/go/internal | |
parent | 709317138fb75724ff229f4a61a5c76a9003fdf0 (diff) | |
download | go-git-ad466d8b87da200fa682f59eca79665addf75138.tar.gz |
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>
Diffstat (limited to 'src/go/internal')
-rw-r--r-- | src/go/internal/gcimporter/gcimporter.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/go/internal/gcimporter/gcimporter.go b/src/go/internal/gcimporter/gcimporter.go index 2185f5b891..cf89fcd1b4 100644 --- a/src/go/internal/gcimporter/gcimporter.go +++ b/src/go/internal/gcimporter/gcimporter.go @@ -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) |