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

Issue 5712044: code review 5712044: path/filepath: note that SplitList is different from st... (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 2 months ago by rsc
Modified:
12 years, 2 months ago
Reviewers:
brainman, r2
CC:
golang-dev, r, bradfitz, gustavo_niemeyer.net
Visibility:
Public.

Description

path/filepath: note that SplitList is different from strings.Split

Patch Set 1 #

Patch Set 2 : diff -r a6e732d1523e https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r a6e732d1523e https://go.googlecode.com/hg/ #

Patch Set 4 : diff -r a6e732d1523e https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -0 lines) Patch
M src/pkg/path/filepath/path.go View 1 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 12
rsc
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 2 months ago (2012-02-29 20:35:42 UTC) #1
r
LGTM
12 years, 2 months ago (2012-02-29 20:41:45 UTC) #2
bradfitz
LGTM I guess asking for an Example here might not work too well with the ...
12 years, 2 months ago (2012-02-29 20:42:19 UTC) #3
gustavo_niemeyer.net
> path/filepath: note that SplitList is different from strings.Split On a vaguely related note, is ...
12 years, 2 months ago (2012-02-29 20:43:42 UTC) #4
rsc
I have no idea what the point of filepath.HasPrefix is. If it was a month ...
12 years, 2 months ago (2012-02-29 20:50:16 UTC) #5
rsc
*** Submitted as http://code.google.com/p/go/source/detail?r=3ae1a805bc09 *** path/filepath: note that SplitList is different from strings.Split R=golang-dev, r, ...
12 years, 2 months ago (2012-02-29 20:50:49 UTC) #6
r2
On 01/03/2012, at 7:50 AM, Russ Cox wrote: > I have no idea what the ...
12 years, 2 months ago (2012-02-29 20:53:12 UTC) #7
rsc
I started to write a comment about what it does that would make clear when ...
12 years, 2 months ago (2012-02-29 20:59:11 UTC) #8
bradfitz
I'd never even noticed that function before. My small vote says kill it. On Wed, ...
12 years, 2 months ago (2012-02-29 21:06:01 UTC) #9
gustavo_niemeyer.net
On Wed, Feb 29, 2012 at 17:59, Russ Cox <rsc@golang.org> wrote: > I started to ...
12 years, 2 months ago (2012-02-29 21:07:35 UTC) #10
brainman
On 2012/02/29 20:50:16, rsc wrote: > I have no idea what the point of filepath.HasPrefix ...
12 years, 2 months ago (2012-03-01 02:05:00 UTC) #11
rsc
12 years, 2 months ago (2012-03-01 04:42:04 UTC) #12
On Wed, Feb 29, 2012 at 21:05,  <alex.brainman@gmail.com> wrote:
> The reason behind of filepath.HasPrefix is that we can compare paths on
> windows. Is file c:\a\b lives in directory C:\a ? It does according to
> Windows. We were using strings.HasPrefix before to answer that question,
> and that was not acceptable. So I introduced filepath.HasPrefix so we
> could do that check without care about GOOS.

That makes sense to me now; thanks.  As pointed out in the
other CL, I think it works better to have a separate utility for
canonicalizing paths, so that instead of having special ops
like this one you can write

strings.HasPrefix(canonical(path1), canonical(path2))

or even build more complex things, like HasSubdir.

For better or worse it appears that canonical is spelled EvalSymlinks.

Russ
Sign in to reply to this message.

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