summaryrefslogtreecommitdiff
path: root/src/go/internal
diff options
context:
space:
mode:
authorTobias Klauser <tklauser@distanz.ch>2018-03-09 11:35:18 +0100
committerTobias Klauser <tobias.klauser@gmail.com>2018-03-09 15:00:06 +0000
commitad466d8b87da200fa682f59eca79665addf75138 (patch)
tree8e4f77af3c2c01aac0f7bbf4d2468b6f980cd37d /src/go/internal
parent709317138fb75724ff229f4a61a5c76a9003fdf0 (diff)
downloadgo-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.go4
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)