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

Issue 2476041: code review 2476041: path: add Glob (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
15 years, 2 months ago by bsiegert
Modified:
15 years, 1 month ago
Reviewers:
CC:
rsc, r, r2, golang-dev
Visibility:
Public.

Description

path: add Glob As discussed in http://groups.google.com/group/golang-dev/browse_thread/thread/926b7d550d98ec9e, add a simple "path expander" function, which returns all the files matching the given pattern. This function is called Glob after glob(3) in libc. Also add a convenience function, hasMeta, that checks whether a string contains one of the characters which are specially handled by Match.

Patch Set 1 #

Patch Set 2 : code review 2476041: Add path.Glob and path.ContainsMagic #

Patch Set 3 : code review 2476041: Add path.Glob and path.ContainsMagic #

Patch Set 4 : code review 2476041: Add path.Glob and path.ContainsMagic #

Total comments: 10

Patch Set 5 : code review 2476041: path: add Glob #

Patch Set 6 : code review 2476041: path: add Glob #

Patch Set 7 : code review 2476041: path: add Glob #

Total comments: 8

Patch Set 8 : code review 2476041: path: add Glob #

Patch Set 9 : code review 2476041: path: add Glob #

Total comments: 14

Patch Set 10 : code review 2476041: path: add Glob #

Unified diffs Side-by-side diffs Delta from patch set Stats (+98 lines, -0 lines) Patch
M src/pkg/path/match.go View 1 2 3 4 5 6 7 8 9 2 chunks +70 lines, -0 lines 0 comments Download
M src/pkg/path/match_test.go View 1 chunk +28 lines, -0 lines 0 comments Download

Messages

Total messages: 20
bsiegert
Hello rsc, golang-dev@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change.
15 years, 2 months ago (2010-10-14 19:11:29 UTC) #1
bsiegert
Ping? On Thu, Oct 14, 2010 at 21:11, <bsiegert@gmail.com> wrote: > Reviewers: rsc, golang-dev_golang.org, > ...
15 years, 2 months ago (2010-10-22 07:56:12 UTC) #2
rsc
This is pretty nice code. Thanks. ContainsMagic isn't the right name. Maybe HasWildcard, or better, ...
15 years, 2 months ago (2010-10-22 13:56:42 UTC) #3
r2
On Oct 22, 2010, at 6:56 AM, Russ Cox wrote: > This is pretty nice ...
15 years, 2 months ago (2010-10-22 14:29:02 UTC) #4
bsiegert
Hello rsc, golang-dev@golang.org, r2 (cc: golang-dev@googlegroups.com), Please take another look.
15 years, 2 months ago (2010-10-26 19:24:39 UTC) #5
rsc1
please add tests http://codereview.appspot.com/2476041/diff/12001/src/pkg/path/match.go File src/pkg/path/match.go (right): http://codereview.appspot.com/2476041/diff/12001/src/pkg/path/match.go#newcode4 src/pkg/path/match.go:4: "container/vector" should be able to use ...
15 years, 2 months ago (2010-11-01 20:36:45 UTC) #6
bsiegert
Hello rsc, r (cc: golang-dev@googlegroups.com), Please take another look.
15 years, 2 months ago (2010-11-04 20:11:23 UTC) #7
bsiegert
Also added tests, as requested. http://codereview.appspot.com/2476041/diff/12001/src/pkg/path/match.go File src/pkg/path/match.go (right): http://codereview.appspot.com/2476041/diff/12001/src/pkg/path/match.go#newcode4 src/pkg/path/match.go:4: "container/vector" On 2010/11/01 20:36:46, ...
15 years, 2 months ago (2010-11-04 20:13:43 UTC) #8
rsc
> On 2010/11/01 20:36:46, rsc1 wrote: >> >> should be iotuil.ReadDir so that you get ...
15 years, 2 months ago (2010-11-04 20:22:21 UTC) #9
bsiegert
Hello rsc, r (cc: golang-dev@googlegroups.com), Please take another look.
15 years, 2 months ago (2010-11-04 20:36:39 UTC) #10
r
http://codereview.appspot.com/2476041/diff/27001/src/pkg/path/match.go File src/pkg/path/match.go (right): http://codereview.appspot.com/2476041/diff/27001/src/pkg/path/match.go#newcode78 src/pkg/path/match.go:78: // Glob returns the names of all files matching ...
15 years, 2 months ago (2010-11-04 20:50:05 UTC) #11
bsiegert
Hello rsc, r (cc: golang-dev@googlegroups.com), Please take another look.
15 years, 2 months ago (2010-11-04 21:21:41 UTC) #12
bsiegert
http://codereview.appspot.com/2476041/diff/27001/src/pkg/path/match.go File src/pkg/path/match.go (right): http://codereview.appspot.com/2476041/diff/27001/src/pkg/path/match.go#newcode78 src/pkg/path/match.go:78: // Glob returns the names of all files matching ...
15 years, 2 months ago (2010-11-04 21:26:25 UTC) #13
r
http://codereview.appspot.com/2476041/diff/37001/src/pkg/path/match.go File src/pkg/path/match.go (right): http://codereview.appspot.com/2476041/diff/37001/src/pkg/path/match.go#newcode208 src/pkg/path/match.go:208: // if there is no matching file. The syntax ...
15 years, 2 months ago (2010-11-04 22:40:34 UTC) #14
bsiegert
Hello rsc, r (cc: golang-dev@googlegroups.com), Please take another look.
15 years, 2 months ago (2010-11-05 11:35:06 UTC) #15
bsiegert
http://codereview.appspot.com/2476041/diff/37001/src/pkg/path/match.go File src/pkg/path/match.go (right): http://codereview.appspot.com/2476041/diff/37001/src/pkg/path/match.go#newcode208 src/pkg/path/match.go:208: // if there is no matching file. The syntax ...
15 years, 2 months ago (2010-11-05 11:36:20 UTC) #16
rsc1
LGTM leaving for r
15 years, 2 months ago (2010-11-05 16:06:34 UTC) #17
r
LGTM
15 years, 2 months ago (2010-11-05 17:37:02 UTC) #18
r2
LGTM -rob
15 years, 2 months ago (2010-11-05 17:40:28 UTC) #19
r
15 years, 2 months ago (2010-11-05 17:48:01 UTC) #20
*** Submitted as http://code.google.com/p/go/source/detail?r=1191d7568243 ***

path: add Glob

As discussed in
http://groups.google.com/group/golang-dev/browse_thread/thread/926b7d550d98ec9e,
add a simple "path expander" function, which returns all the
files matching the given pattern. This function is called Glob
after glob(3) in libc.

Also add a convenience function, hasMeta, that checks whether
a string contains one of the characters which are specially handled
by Match.

R=rsc, r, r2
CC=golang-dev
http://codereview.appspot.com/2476041

Committer: Rob Pike <r@golang.org>
Sign in to reply to this message.

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