Commit ad466d8b authored by Tobias Klauser's avatar Tobias Klauser Committed by Tobias Klauser

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: 's avatarIan Lance Taylor <iant@golang.org>
parent 70931713
...@@ -133,9 +133,7 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func ...@@ -133,9 +133,7 @@ func Import(packages map[string]*types.Package, path, srcDir string, lookup func
}() }()
rc = f rc = f
} }
defer func() { defer rc.Close()
rc.Close()
}()
var hdr string var hdr string
buf := bufio.NewReader(rc) buf := bufio.NewReader(rc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment