Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(94)

Issue 137430043: code review 137430043: go.tools/buildutil: AllPackages: enumerate all packages... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
10 years, 10 months ago by adonovan
Modified:
10 years, 10 months ago
Reviewers:
gri
CC:
golang-codereviews
Visibility:
Public.

Description

go.tools/go/buildutil: AllPackages: enumerate all packages in a Go workspace. This function has been copied at least 6 times throughout go.tools. This implementation is superior since it does all I/O through the virtualized go/build file system, and it is highly parallel (and much faster). We expose two flavours, simple (for existing tests) and parallel (for high-performance tools such as gorename). This CL creates the go/buildutil package, which is intended for utilities related to go/build. + test.

Patch Set 1 #

Patch Set 2 : diff -r 5001f42c2fca8e164078a77e6326f176f900813c https://code.google.com/p/go.tools #

Patch Set 3 : diff -r 5001f42c2fca8e164078a77e6326f176f900813c https://code.google.com/p/go.tools #

Total comments: 20

Patch Set 4 : diff -r 5001f42c2fca8e164078a77e6326f176f900813c https://code.google.com/p/go.tools #

Patch Set 5 : diff -r 5001f42c2fca8e164078a77e6326f176f900813c https://code.google.com/p/go.tools #

Total comments: 4

Patch Set 6 : diff -r 5001f42c2fca8e164078a77e6326f176f900813c https://code.google.com/p/go.tools #

Patch Set 7 : diff -r 5001f42c2fca8e164078a77e6326f176f900813c https://code.google.com/p/go.tools #

Total comments: 14

Patch Set 8 : diff -r 5001f42c2fca8e164078a77e6326f176f900813c https://code.google.com/p/go.tools #

Total comments: 6

Patch Set 9 : diff -r 5001f42c2fca8e164078a77e6326f176f900813c https://code.google.com/p/go.tools #

Total comments: 4

Patch Set 10 : diff -r 5ecf54f7fe4a4abbd5c5556044e31081ea8d1033 https://code.google.com/p/go.tools #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+140 lines, -0 lines) Patch
A go/buildutil/allpackages.go View 1 2 3 4 5 6 7 8 9 1 chunk +108 lines, -0 lines 1 comment Download
A go/buildutil/allpackages_test.go View 1 2 3 4 1 chunk +32 lines, -0 lines 0 comments Download

Messages

Total messages: 18
adonovan
Hello gri@golang.org (cc: golang-codereviews@googlegroups.com), I'd like you to review this change to https://code.google.com/p/go.tools
10 years, 10 months ago (2014-09-09 19:29:38 UTC) #1
gri
https://codereview.appspot.com/137430043/diff/40001/buildutil/allpackages.go File buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/40001/buildutil/allpackages.go#newcode1 buildutil/allpackages.go:1: // Package buildutil provides utilities related to the go/build ...
10 years, 10 months ago (2014-09-09 19:52:37 UTC) #2
adonovan
https://codereview.appspot.com/137430043/diff/40001/buildutil/allpackages.go File buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/40001/buildutil/allpackages.go#newcode1 buildutil/allpackages.go:1: // Package buildutil provides utilities related to the go/build ...
10 years, 10 months ago (2014-09-09 20:22:52 UTC) #3
adonovan
Hello gri@golang.org (cc: golang-codereviews@googlegroups.com), Please take another look.
10 years, 10 months ago (2014-09-09 20:23:35 UTC) #4
gri
update the CL desc - tone down the superiority piece - remove parallel https://codereview.appspot.com/137430043/diff/80001/go/buildutil/allpackages.go File ...
10 years, 10 months ago (2014-09-09 20:37:23 UTC) #5
adonovan
https://codereview.appspot.com/137430043/diff/80001/go/buildutil/allpackages.go File go/buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/80001/go/buildutil/allpackages.go#newcode48 go/buildutil/allpackages.go:48: func AllPackagesConcurrent(ctxt *build.Context, found func(string)) { On 2014/09/09 20:37:22, ...
10 years, 10 months ago (2014-09-09 20:54:55 UTC) #6
gri
https://codereview.appspot.com/137430043/diff/120001/go/buildutil/allpackages.go File go/buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/120001/go/buildutil/allpackages.go#newcode22 go/buildutil/allpackages.go:22: // of $GOPATH). should mention that they are sorted ...
10 years, 10 months ago (2014-09-09 21:11:45 UTC) #7
adonovan
https://codereview.appspot.com/137430043/diff/120001/go/buildutil/allpackages.go File go/buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/120001/go/buildutil/allpackages.go#newcode22 go/buildutil/allpackages.go:22: // of $GOPATH). On 2014/09/09 21:11:44, gri wrote: > ...
10 years, 10 months ago (2014-09-09 21:31:35 UTC) #8
gri
https://codereview.appspot.com/137430043/diff/120001/go/buildutil/allpackages.go File go/buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/120001/go/buildutil/allpackages.go#newcode22 go/buildutil/allpackages.go:22: // of $GOPATH). On 2014/09/09 21:31:34, adonovan wrote: > ...
10 years, 10 months ago (2014-09-09 22:05:44 UTC) #9
adonovan
https://codereview.appspot.com/137430043/diff/120001/go/buildutil/allpackages.go File go/buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/120001/go/buildutil/allpackages.go#newcode22 go/buildutil/allpackages.go:22: // of $GOPATH). On 2014/09/09 22:05:44, gri wrote: > ...
10 years, 10 months ago (2014-09-09 22:12:27 UTC) #10
gri
LGTM but please consider the rename. https://codereview.appspot.com/137430043/diff/160001/go/buildutil/allpackages.go File go/buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/160001/go/buildutil/allpackages.go#newcode52 go/buildutil/allpackages.go:52: // TODO(adonovan): options ...
10 years, 10 months ago (2014-09-09 22:20:50 UTC) #11
adonovan
https://codereview.appspot.com/137430043/diff/160001/go/buildutil/allpackages.go File go/buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/160001/go/buildutil/allpackages.go#newcode52 go/buildutil/allpackages.go:52: // TODO(adonovan): options for serial traversal and/or rate-limiting. On ...
10 years, 10 months ago (2014-09-09 22:36:09 UTC) #12
adonovan
*** Submitted as https://code.google.com/p/go/source/detail?r=f7cd03c2866c&repo=tools *** go.tools/go/buildutil: AllPackages: enumerate all packages in a Go workspace. This ...
10 years, 10 months ago (2014-09-09 22:39:17 UTC) #13
gri
https://codereview.appspot.com/137430043/diff/170001/go/buildutil/allpackages.go File go/buildutil/allpackages.go (right): https://codereview.appspot.com/137430043/diff/170001/go/buildutil/allpackages.go#newcode64 go/buildutil/allpackages.go:64: func allPackages(ctxt *build.Context, root string, found func(string, error)) { ...
10 years, 10 months ago (2014-09-10 01:21:03 UTC) #14
adonovan
Yeah; the original filepath.Walk had this feature and we used it to prune the "testdata" ...
10 years, 10 months ago (2014-09-10 02:39:40 UTC) #15
gri
I like AllPackages for the list. How about EnumPackage instead of ForEachPackage? - gri On ...
10 years, 10 months ago (2014-09-10 18:58:40 UTC) #16
adonovan
On 10 September 2014 14:58, Robert Griesemer <gri@golang.org> wrote: > I like AllPackages for the ...
10 years, 10 months ago (2014-09-11 18:10:20 UTC) #17
adonovan
10 years, 10 months ago (2014-09-11 18:24:30 UTC) #18
https://codereview.appspot.com/142930043

On 11 September 2014 14:10, Alan Donovan <adonovan@google.com> wrote:

> On 10 September 2014 14:58, Robert Griesemer <gri@golang.org> wrote:
>
>> I like AllPackages for the list.
>>
>> How about EnumPackage instead of ForEachPackage?
>>
>
> I prefer ForEach; it has a long tradition of specifically meaning "apply
> this function to each item".  Enumerate has a range of meanings: C 'enum'
> data types, Java 'Enumeraton' iterators, Python's enumerate builtin
> analogous to "for i, x := range slice".
>
>
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b