]> Cypherpunks repositories - gostls13.git/commit
go/build: refactor per-file info & reader
authorRuss Cox <rsc@golang.org>
Mon, 19 Oct 2020 00:26:46 +0000 (20:26 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 20 Oct 2020 20:44:22 +0000 (20:44 +0000)
commit80182d45b5d2ff86da7b6587a2a09d8924dd0a95
treee530ab22e0a1b280c41375ce35a6e7353b45a81f
parent7f736694fe9b254efa7155a0a5da87c2c18e6078
go/build: refactor per-file info & reader

Make code cleaner and a bit more adaptable:
instead of an ever-growing list of arguments and results for readImports,
put everything in a fileInfo struct, and rename function to readGoInfo.
(Not a goInfo struct because it gets used for non-Go source files as well,
but that processing is much simpler.)

The refactoring simplifies the embed work in the next CL,
but this CL makes no semantic changes.

For #41191.

Change-Id: Id2de2a3b8d351adc1c919dcf79dfbe79fc3d5301
Reviewed-on: https://go-review.googlesource.com/c/go/+/243940
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/go/build/build.go
src/go/build/deps_test.go
src/go/build/read.go
src/go/build/read_test.go