I omitted vendor directories and anything necessary for bootstrapping.
(Tested by bootstrapping with Go 1.4)
Updates #27864
Change-Id: I7d9b68d0372d3a34dee22966cca323513ece7e8a
Reviewed-on: https://go-review.googlesource.com/137856
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
For a relative symlink in the root directory, such as /tmp ->
private/tmp, we were dropping the leading slash.
No test because we can't create a symlink in the root directory.
The test TestGZIPFilesHaveZeroMTimes was failing on the Darwin builders.
Updates #19922
Updates #20506
Change-Id: Ic83cb6d97ad0cb628fc551ac772a44fb3e20f038
Reviewed-on: https://go-review.googlesource.com/135295
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
Rather than try to work around Clean and Join on intermediate steps,
which can remove ".." components unexpectedly, just do everything in
walkSymlinks. Use a single loop over path components.
Fixes#23444
Change-Id: I4f15e50d0df32349cc4fd55e3d224ec9ab064379
Reviewed-on: https://go-review.googlesource.com/121676
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
The message was hardcoded to indicate that the test wanted a nil error, even
though in some cases a specific error was wanted. This patch fixes the
message to print the wanted error.
Change-Id: Id86ea89d6f41f25bfa164acc50142ae8ff0ec410
GitHub-Last-Rev: c220374845
GitHub-Pull-Request: golang/go#26674
Reviewed-on: https://go-review.googlesource.com/126619
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
If a filepath.WalkFunc is called with an non-nil err argument, it's possible
that the info argument will be nil. The comment above filepath.WalkFunc now
reflects this.
Fixes#26425
Change-Id: Ib9963b3344587d2993f1698c5a801f2d1286856b
GitHub-Last-Rev: 553fc266b5
GitHub-Pull-Request: golang/go#26435
Reviewed-on: https://go-review.googlesource.com/124635
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Relates to #9679
Change-Id: I68951f664d2a03812dae309c580c181869d8af21
Reviewed-on: https://go-review.googlesource.com/122237
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit adds the js/wasm architecture to the os package.
Access to the actual file system is supported through Node.js.
Updates #18892
Change-Id: I6fa642fb294ca020b2c545649d4324d981aa0408
Reviewed-on: https://go-review.googlesource.com/109977
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The current Abs docs say:
// If the path is not absolute it will be joined with the current
// working directory to turn it into an absolute path.
The empty string is not an absolute path, so the docs suggest that the
empty string should be joined with the current working directory to
turn it into an absolute path. This was already the case on all
platforms other than Windows. Per the decision in issue #24441,
this change makes it work on Windows too.
Since the empty string is not a valid path for the purposes of calling
os.Stat on it, we can't simply add the empty string test case to
absTests, which TestAbs uses. It would error when trying to do:
info, err := os.Stat(path)
I didn't find a good way to modify TestAbs to handle this situation
without significantly complicating its code and compromising the test.
So, a separate test is created for testing Abs on empty string input.
Fixes#24441.
Change-Id: I11d8ae2f6e6e358f3e996372ee2a0449093898d2
Reviewed-on: https://go-review.googlesource.com/112935
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
'%SystemRoot%/System32/chcp.com' is a tool on Windows that
is used to change the active code page in the console.
'go test path/filepath' can fail with:
"'chcp' is not recognized as an internal or external command"
The test uses a custom PATH variable but does not include
'%SystemRoot%/System32'. Always append that to PATH.
Updates #24709
Change-Id: Ib4c83ffdcc5dd6eb7bb34c07386cf2ab61dcae57
GitHub-Last-Rev: fac92613cc
GitHub-Pull-Request: golang/go#25089
Reviewed-on: https://go-review.googlesource.com/109362
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This change makes errors in the example code a bit better, as it's no use to show the root dir when an error occurs walking a subdirectory or file.
Change-Id: I546276e9b151fabba5357258f03bfbd47a508201
GitHub-Last-Rev: 398c1eeb61
GitHub-Pull-Request: golang/go#24536
Reviewed-on: https://go-review.googlesource.com/102535
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
We should avoid writing temp files to GOROOT, since it might be readonly.
Fixes#23881
Change-Id: Iaa38ec404b303f0cf27fdfb7daf1ddd60fd5d1c9
GitHub-Last-Rev: de0211df84
GitHub-Pull-Request: golang/go#24238
Reviewed-on: https://go-review.googlesource.com/98517
Run-TryBot: Giovanni Bajo <rasky@develer.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Backslashes are ignored in Match and Glob on Windows, since those
collide with the separator character. However, they should still work in
both functions on other operating systems.
hasMeta did not reflect this logic - it always treated a backslash as a
non-special character. Do that only on Windows.
Assuming this is what the TODO was referring to, remove it. There are no
other characters that scanChunk treats especially.
Fixes#23418.
Change-Id: Ie0bd795812e0ed9d8c8c1bbc3137f29d960cba84
Reviewed-on: https://go-review.googlesource.com/87455
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
path.Match works purely with strings, not file paths. That's what sets
it apart from filepath.Match. For example, only filepath.Match will
change its behavior towards backslashes on Windows, to accomodate for
the file path separator on that system.
As such, path.Match should make no mention of file names. Nor should
path.ErrBadPattern mention globbing at all - the package has no notion
of globbing, and the error concerns only patterns.
For a similar reason, remove the mention of globbing from
filepath.ErrBadPattern. The error isn't reserved to just globbing, as it
can be returned from filepath.Match. And, as before, it only concerns
the patterns themselves.
Change-Id: I58a83ffa3e2549625d8e546ef916652525504bd1
Reviewed-on: https://go-review.googlesource.com/87857
Reviewed-by: Rob Pike <r@golang.org>
Fixes: #22052
Change-Id: Ia056871b35ecc1a8c5ac891402fc1c5702731623
Reviewed-on: https://go-review.googlesource.com/66330
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
strings.LastIndexByte was introduced in go1.5 and it can be used
effectively wherever the second argument to strings.LastIndex is
exactly one byte long.
This avoids generating unnecessary string symbols and saves
a few calls to strings.LastIndex.
Change-Id: I7b5679d616197b055cffe6882a8675d24a98b574
Reviewed-on: https://go-review.googlesource.com/66372
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Before this change, if Walk encounters an unreadable directory,
it will call walkFn with this directory twice. Argument err in
the first call is nil, and the second is the permission error.
This change removes the former call and makes Walk call walkFn
with permission error.
Fixes#21758
Change-Id: I21e57c67f3c5a8370fc80a43db3c8009fbce6439
Reviewed-on: https://go-review.googlesource.com/63994
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
It doesn't change the outcome. It might have been useful at some point
to avoid Replace from doing work or allocating. However, nowadays the
func returns early without doing any work if Count returns 0.
Change-Id: Id69dc74042a6e39672b405016484db8b50f43d58
Reviewed-on: https://go-review.googlesource.com/62991
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Dave Cheney <dave@cheney.net>
Change-Id: I143203a9dcf9a4da0e53a3aab6e370244b849296
Reviewed-on: https://go-review.googlesource.com/62270
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Make it dead simple to see visually what the function outputs in
various scenarios.
Change-Id: I8f6fcd72fa1515361481f0510412cde221e1d4e3
Reviewed-on: https://go-review.googlesource.com/51630
Run-TryBot: Kevin Burke <kev@inburke.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Hiroshi Ioka <hirochachacha@gmail.com>
The path package has a reference to the path/filepath package, so add
a reverse reference.
And clarify the path package doesn't do Windows paths.
Fixes#20117
Change-Id: I65c5ce24e600b32ea20c5821b744bd89f6aff98c
Reviewed-on: https://go-review.googlesource.com/45653
Reviewed-by: Jaana Burcu Dogan <jbd@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This change adds several examples, with emphasis on special or edge
cases such as a directory parameter consisting of an empty string.
Change-Id: Ib4ac3d0f6d503493eeed0c4fda7c12acf782e9e2
Reviewed-on: https://go-review.googlesource.com/43010
Reviewed-by: Steve Francia <spf@golang.org>
Run-TryBot: Jaana Burcu Dogan <jbd@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
When using Lstat against symlinks that point to a directory,
the function returns FileInfo with both ModeDir and ModeSymlink set.
Change that to never set ModeDir if ModeSymlink is set.
Fixes#10424Fixes#17540Fixes#17541
Change-Id: Iba280888aad108360b8c1f18180a24493fe7ad2b
Reviewed-on: https://go-review.googlesource.com/41830
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Mostly unnecessary *testing.T arguments.
Found with github.com/mvdan/unparam.
Change-Id: Ifb955cb88f2ce8784ee4172f4f94d860fa36ae9a
Reviewed-on: https://go-review.googlesource.com/41691
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
For #17540.
Change-Id: Ie01f39797526934fa553f4279cbde6c7cbf14154
Reviewed-on: https://go-review.googlesource.com/36854
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The environment variables used in those tests override the default
OS ones. However, one of them (SystemRoot) seems to be required on
some Windows systems for invoking cmd.exe properly.
This fixes#4930 and #6568.
Change-Id: I23dfb67c1de86020711a3b59513f6adcbba12561
Reviewed-on: https://go-review.googlesource.com/36873
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Change-Id: I429637ca91f7db4144f17621de851a548dc1ce76
Reviewed-on: https://go-review.googlesource.com/34923
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Use the new "Deprecated:" syntax for all instances of HasPrefix.
This is a follow-up to http://golang.org/cl/28413 which only modified path_unix.go.
In this CL, we avoid mentioning that strings.HasPrefix should be used since
that function is still subtly wrong in security applications.
See http://golang.org/cl/5712045 for more information.
Fixes#18355
Change-Id: I0d0306152cd0b0ea5110774c2c78117515b9f5cd
Reviewed-on: https://go-review.googlesource.com/34554
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
The filepath.Abs function in windows did not call Clean as the
documentation claimed. This change not only fixes that behavior but
also adjusts TestAbs to verify Abs calls Clean as documented.
Fixes#17210
Change-Id: I20c5f5026042fd7bd9d929ff5b17c8b2653f8afe
Reviewed-on: https://go-review.googlesource.com/32292
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The old code leaves garbages in a temporary directory because it
cannot remove the current working directory on windows.
The new code changes the directory before calling os.Remove.
Furthermore, the old code assumes that ioutil.TempDir (os.TempDir)
doesn't return a relative path nor an UNC path.
If it isn't the case, the new code calls t.Fatal earlier for preventing
ambiguous errors.
Finally, the old code reassigns the variable which is used by the defer
function. It could cause unexpected results, so avoid that.
Change-Id: I5fc3902059ecaf18dc1341ecc4979d1206034cd7
Reviewed-on: https://go-review.googlesource.com/31790
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
It appears to be a vestigial holding ground for bugs.
But we have an issue tracker, and #1909 is there and open.
Change-Id: I912ff222a24c51fab483be0c67dad534f5a84488
Reviewed-on: https://go-review.googlesource.com/31859
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
\\?\c:\ is a "root directory" that is not subject to further matching,
but the ? makes it look like a pattern, which was causing an
infinite recursion. Make sure the code understands the ? is not a pattern.
Fixes#15879.
Change-Id: I3a4310bbc398bcae764b9f8859c875317345e757
Reviewed-on: https://go-review.googlesource.com/31460
Reviewed-by: Quentin Smith <quentin@golang.org>
EvalSymlinks returns error if given path or its target path don't exist.
Add a test for future improvement.
Change-Id: Ic9a4aa5eaee0fe7ac523d54d8eb3132a11b380b3
Reviewed-on: https://go-review.googlesource.com/27330
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
This is a followup to CL 24747, where the package doc phrase
"Functions in this package replace occurrences of slash unless otherwise specified."
was removed. The phrase was originally added in CL 7310 together
with this explicit opt out statement for SplitList.
Remove it since it's no longer neccessary. This helps consistency.
Updates #16111.
Updates #10122.
Change-Id: Iba86de57c24100adecac9cb5892ce180126c0ea6
Reviewed-on: https://go-review.googlesource.com/25250
Reviewed-by: Russ Cox <rsc@golang.org>
Current code assumes there are not ".." in the Clean(path).
That's not true. Clean doesn't handle leading "..", so we need to stop
normalization if we see "..".
Fixes#16793
Change-Id: I0a7901bedac17f1210b134d593ebd9f5e8483775
Reviewed-on: https://go-review.googlesource.com/27410
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
If the walker function called on a top-level file returns SkipDir,
then (before this change) Walk would return SkipDir, which the
documentation implies will not happen.
Fixes#16280.
Change-Id: I37d63bdcef7af4b56e342b624cf0d4b42e65c297
Reviewed-on: https://go-review.googlesource.com/24780
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Document explicitly which functions Clean the result rather than
documenting it in the package comment.
Updates #10122.
Fixes#16111.
Change-Id: Ia589c7ee3936c9a6a758725ac7f143054d53e41e
Reviewed-on: https://go-review.googlesource.com/24747
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This is a minimal fix to prevent this and
other possible future infinite recursion.
We can put in a proper fix for UNC in Go 1.8.
Updates #15879
Change-Id: I3653cf5891bab8511adf66fa3c1a1d8912d1a293
Reviewed-on: https://go-review.googlesource.com/23572
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
The problem was introduced by the recent filepath.Join change.
Fixes#14949
Change-Id: I7ee52f210e12bbb1369e308e584ddb2c7766e095
Reviewed-on: https://go-review.googlesource.com/23240
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
The previous cleanup was done with a buggy tool, missing some potential
rewrites.
Change-Id: I333467036e355f999a6a493e8de87e084f374e26
Reviewed-on: https://go-review.googlesource.com/21378
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Current implementation uses GetShortPathName and GetLongPathName
to get a normalized path. That approach sometimes fails because
user can disable short path name anytime. This CL provides
an alternative approach suggested by MSDN.
https://msdn.microsoft.com/en-us/library/windows/desktop/aa364989(v=vs.85).aspxFixes#13980
Change-Id: Icf4afe4c9c4b507fc110c1483bf8db2c3f606b0a
Reviewed-on: https://go-review.googlesource.com/20860
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This makes clear that Go's path.Join and filepath.Join are different
from the Python os.path.join (and perhaps others).
Requested in private mail.
Change-Id: Ie5dfad8a57f9baa5cca31246af1fd4dd5b1a64ee
Reviewed-on: https://go-review.googlesource.com/20711
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TestEvalSymlinksCanonicalNames fails on system where 8dot3 name creation
is disabled. Add new test that temporarily changes 8dot3 name creation
file system setting and runs TestEvalSymlinksCanonicalNames under that
setting. New test requires administrator access and modifies important
file system setting, so don't run the test unless explicitly requested
by specifying new test flag.
Updates #13980
Change-Id: I598b5b956e6bd0ed556e79d350cb244808c89c0b
Reviewed-on: https://go-review.googlesource.com/20863
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
The Join test was doing something remarkable and unnecessary instead of
just using ... on a slice. Maybe it was an editing relic.
Fix it by deleting the monstrosity.
Change-Id: I5b90c6d539d334a9c27e57d26dacd831721cfcfe
Reviewed-on: https://go-review.googlesource.com/20727
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
The tree's pretty inconsistent about single space vs double space
after a period in documentation. Make it consistently a single space,
per earlier decisions. This means contributors won't be confused by
misleading precedence.
This CL doesn't use go/doc to parse. It only addresses // comments.
It was generated with:
$ perl -i -npe 's,^(\s*// .+[a-z]\.) +([A-Z]),$1 $2,' $(git grep -l -E '^\s*//(.+\.) +([A-Z])')
$ go test go/doc -update
Change-Id: Iccdb99c37c797ef1f804a94b22ba5ee4b500c4f7
Reviewed-on: https://go-review.googlesource.com/20022
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Dave Day <djd@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Otherwise it's hard to tell the difference between
link1 and link2 or other tests.
Change-Id: I36c153cccb10959535595938dfbc49db930b9fac
Reviewed-on: https://go-review.googlesource.com/17851
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
EvalSymlinks code assumes that Join has a bug
(see issue #11551 for details). But issue #11551 has
been fixed. Remove the workaround so it does not
confuses us when we read code next time.
Change-Id: I06bea20189f01f9922237c05516847353d8e4736
Reviewed-on: https://go-review.googlesource.com/17620
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This is CL 11882 brought back to life.
Fixes#11551
Change-Id: I29810183957745442d1e9937f56a66fc9c6cc82a
Reviewed-on: https://go-review.googlesource.com/17470
Reviewed-by: Russ Cox <rsc@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Compare basepath and targetpath using strings.EqualFold. The absence
of this on Windows causes an unterminating condition in `for` statement
later in the function.
Fixes#13258
Change-Id: Ib5a0caba864ee425dc75ece47b9cf6fb626f47f1
Reviewed-on: https://go-review.googlesource.com/16857
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
On Windows, Rel emits error messages of the form `Rel: can't make
\windows relative to \windows`. Rather than emitting paths after
stripping volume names, emit the original paths so as to make those of
the form `Rel: can't make d:\windows relative to c:\windows`. Fixed a
test that expected the error message to emit clean path instead of the
original.
Fixes#13259
Change-Id: I3a9bd5b137205f22794ec8046b4e917ee48cf750
Reviewed-on: https://go-review.googlesource.com/16858
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Fixes#10802
Compare Volume name and each path elements using strings.EqualFold.
Change-Id: Ibdefdb801d0326e53755bc9cc8c10eed998094e5
Reviewed-on: https://go-review.googlesource.com/16795
Reviewed-by: Russ Cox <rsc@golang.org>
Also new tests added. So, perhaps, this CL corrects
even more broken EvalSymlinks behaviour.
Fixes#12451
Change-Id: I81b9d92bab74bcb8eca6db6633546982fe5cec87
Reviewed-on: https://go-review.googlesource.com/16192
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Alex Brainman <alex.brainman@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
When you create C:\A.TXT file on windows, you can open it as c:\a.txt.
EvalSymlinks("c:\a.txt") returns C:\A.TXT. This is all EvalSymlinks
did in the past, but recently symlinks functionality been implemented on
some Windows version (where symlinks are supported). So now EvalSymlinks
handles both: searching for file canonical name and resolving symlinks.
Unfortunately TestEvalSymlinks has not been adjusted properly. The test
tests either canonical paths or symlinks, but not both. This CL separates
canonical paths tests into new TestEvalSymlinksCanonicalNames, so all
functionality is covered. Tests are simplified somewhat too.
Also remove EvalSymlinksAbsWindowsTests - it seems not used anywhere.
Change-Id: Id12e9f1441c1e30f15c523b250469978e4511a84
Reviewed-on: https://go-review.googlesource.com/14412
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Could go in 1.5, although not critical.
See also #12107
Change-Id: I7f1608b58581d21df4db58f0db654fef79e33a90
Reviewed-on: https://go-review.googlesource.com/13481
Reviewed-by: Dave Cheney <dave@cheney.net>
The one in misc/makerelease/makerelease.go is particularly bad and
probably warrants rotating our keys.
I didn't update old weekly notes, and reverted some changes involving
test code for now, since we're late in the Go 1.5 freeze. Otherwise,
the rest are all auto-generated changes, and all manually reviewed.
Change-Id: Ia2753576ab5d64826a167d259f48a2f50508792d
Reviewed-on: https://go-review.googlesource.com/12048
Reviewed-by: Rob Pike <r@golang.org>
This behavior is not what we might have designed from the start,
but it has been present since Go 1. Rather than make a visible
behavioral change that might cause programs to work differently
in Go ≤1.4 vs Go ≥1.5, document what SkipDir on a non-directory
has always meant. If code doesn't want this meaning, it is easy
enough not to return SkipDir on non-directories.
Fixes#10533.
Change-Id: Ic0612f032044bc7c69bf62583a02037e4b47530b
Reviewed-on: https://go-review.googlesource.com/11690
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
Just like darwin/arm.
Change-Id: I4b0ab4a104f2c8a821ca8b5fa8d266e51883709f
Reviewed-on: https://go-review.googlesource.com/8816
Reviewed-by: Minux Ma <minux@golang.org>
The slash is replaced with os.PathSeparator before returning.
Split, SplitList are the exceptions; comments for them mention this.
Fixesgolang/go#10122.
Change-Id: I66dbee8d09f378582e046be8df309a3930151820
Reviewed-on: https://go-review.googlesource.com/7310
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Reviewed-by: Rob Pike <r@golang.org>
Only documentation / comment changes. Update references to
point to golang.org permalinks or go.googlesource.com/go.
References in historical release notes under doc are left as is.
Change-Id: Icfc14e4998723e2c2d48f9877a91c5abef6794ea
Reviewed-on: https://go-review.googlesource.com/4060
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Unless the first element is a Universal Naming Convention (UNC)[0]
path, Join shouldn't create a UNC path on Windows.
For example, Join inadvertently creates a UNC path on Windows when
told to join at least three non-empty path elements, where the first
element is `\` or `/`.
This CL prevents creation of a UNC path prefix when the first path
element isn't a UNC path.
Since this introduces some amount of Windows-specific logic, Join is
moved to a per GOOS implementation.
Fixes#9167.
[0]: http://msdn.microsoft.com/en-us/library/gg465305.aspx
Change-Id: Ib6eda597106cb025137673b33c4828df1367f75b
Reviewed-on: https://go-review.googlesource.com/2211
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Fix style by removing unnecessary named result parameter.
Fix doc comment while here.
Change-Id: If8394e696ab37e00a95484d5137955aa06c59520
Reviewed-on: https://go-review.googlesource.com/1781
Reviewed-by: Yasuhiro MATSUMOTO <mattn.jp@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>