diff options
| author | Daniel Martà <mvdan@mvdan.cc> | 2017-03-17 16:05:31 +0000 |
|---|---|---|
| committer | Brad Fitzpatrick <bradfitz@golang.org> | 2017-03-21 02:47:36 +0000 |
| commit | 346d5883eb53d3e3a5bac7ee37beaa3db5c01fd8 (patch) | |
| tree | 9247eaec34b95f68c816de1a81775456297cc9f9 /src | |
| parent | 80c4b53e1e5159cc440e52c906583edc1eb79abc (diff) | |
| download | go-346d5883eb53d3e3a5bac7ee37beaa3db5c01fd8.tar.xz | |
go/build: remove unused returnImports parameter
The code uses the filename suffix instead of the bool parameter to
determine what to do.
Fixes #19474.
Change-Id: Ic552a54e50194592a4b4ae7f74d3109af54e6d36
Reviewed-on: https://go-review.googlesource.com/38265
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/go/build/build.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/go/build/build.go b/src/go/build/build.go index 5ced41ce45..c1f07c959a 100644 --- a/src/go/build/build.go +++ b/src/go/build/build.go @@ -722,7 +722,7 @@ Found: p.InvalidGoFiles = append(p.InvalidGoFiles, name) } - match, data, filename, err := ctxt.matchFile(p.Dir, name, true, allTags, &p.BinaryOnly) + match, data, filename, err := ctxt.matchFile(p.Dir, name, allTags, &p.BinaryOnly) if err != nil { badFile(err) continue @@ -1036,19 +1036,19 @@ func parseWord(data []byte) (word, rest []byte) { // MatchFile considers the name of the file and may use ctxt.OpenFile to // read some or all of the file's content. func (ctxt *Context) MatchFile(dir, name string) (match bool, err error) { - match, _, _, err = ctxt.matchFile(dir, name, false, nil, nil) + match, _, _, err = ctxt.matchFile(dir, name, nil, nil) return } // matchFile determines whether the file with the given name in the given directory // should be included in the package being constructed. // It returns the data read from the file. -// If returnImports is true and name denotes a Go program, matchFile reads -// until the end of the imports (and returns that data) even though it only -// considers text until the first non-comment. +// If name denotes a Go program, matchFile reads until the end of the +// imports (and returns that data) even though it only considers text +// until the first non-comment. // If allTags is non-nil, matchFile records any encountered build tag // by setting allTags[tag] = true. -func (ctxt *Context) matchFile(dir, name string, returnImports bool, allTags map[string]bool, binaryOnly *bool) (match bool, data []byte, filename string, err error) { +func (ctxt *Context) matchFile(dir, name string, allTags map[string]bool, binaryOnly *bool) (match bool, data []byte, filename string, err error) { if strings.HasPrefix(name, "_") || strings.HasPrefix(name, ".") { return |
