diff options
author | Russ Cox <rsc@golang.org> | 2022-02-03 14:12:08 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2022-04-11 16:34:30 +0000 |
commit | 19309779ac5e2f5a2fd3cbb34421dafb2855ac21 (patch) | |
tree | 67dfd3e5d96250325e383183f95b6f5fe1968514 /src/path | |
parent | 017933163ab6a2b254f0310c61b57db65cded92e (diff) | |
download | go-19309779ac5e2f5a2fd3cbb34421dafb2855ac21.tar.gz go-19309779ac5e2f5a2fd3cbb34421dafb2855ac21.zip |
all: gofmt main repo
[This CL is part of a sequence implementing the proposal #51082.
The design doc is at https://go.dev/s/godocfmt-design.]
Run the updated gofmt, which reformats doc comments,
on the main repository. Vendored files are excluded.
For #51082.
Change-Id: I7332f099b60f716295fb34719c98c04eb1a85407
Reviewed-on: https://go-review.googlesource.com/c/go/+/384268
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Diffstat (limited to 'src/path')
-rw-r--r-- | src/path/filepath/path.go | 14 | ||||
-rw-r--r-- | src/path/filepath/path_windows_test.go | 16 | ||||
-rw-r--r-- | src/path/filepath/symlink_windows.go | 11 | ||||
-rw-r--r-- | src/path/path.go | 12 |
4 files changed, 29 insertions, 24 deletions
diff --git a/src/path/filepath/path.go b/src/path/filepath/path.go index 668b87bb24..ec9e6d8a1f 100644 --- a/src/path/filepath/path.go +++ b/src/path/filepath/path.go @@ -67,13 +67,13 @@ const ( // by purely lexical processing. It applies the following rules // iteratively until no further processing can be done: // -// 1. Replace multiple Separator elements with a single one. -// 2. Eliminate each . path name element (the current directory). -// 3. Eliminate each inner .. path name element (the parent directory) -// along with the non-.. element that precedes it. -// 4. Eliminate .. elements that begin a rooted path: -// that is, replace "/.." by "/" at the beginning of a path, -// assuming Separator is '/'. +// 1. Replace multiple Separator elements with a single one. +// 2. Eliminate each . path name element (the current directory). +// 3. Eliminate each inner .. path name element (the parent directory) +// along with the non-.. element that precedes it. +// 4. Eliminate .. elements that begin a rooted path: +// that is, replace "/.." by "/" at the beginning of a path, +// assuming Separator is '/'. // // The returned path ends in a slash only if it represents a root directory, // such as "/" on Unix or `C:\` on Windows. diff --git a/src/path/filepath/path_windows_test.go b/src/path/filepath/path_windows_test.go index 76a459ac96..37019210fa 100644 --- a/src/path/filepath/path_windows_test.go +++ b/src/path/filepath/path_windows_test.go @@ -197,13 +197,17 @@ func TestEvalSymlinksCanonicalNames(t *testing.T) { // (where c: is vol parameter) to discover "8dot3 name creation state". // The state is combination of 2 flags. The global flag controls if it // is per volume or global setting: -// 0 - Enable 8dot3 name creation on all volumes on the system -// 1 - Disable 8dot3 name creation on all volumes on the system -// 2 - Set 8dot3 name creation on a per volume basis -// 3 - Disable 8dot3 name creation on all volumes except the system volume +// +// 0 - Enable 8dot3 name creation on all volumes on the system +// 1 - Disable 8dot3 name creation on all volumes on the system +// 2 - Set 8dot3 name creation on a per volume basis +// 3 - Disable 8dot3 name creation on all volumes except the system volume +// // If global flag is set to 2, then per-volume flag needs to be examined: -// 0 - Enable 8dot3 name creation on this volume -// 1 - Disable 8dot3 name creation on this volume +// +// 0 - Enable 8dot3 name creation on this volume +// 1 - Disable 8dot3 name creation on this volume +// // checkVolume8dot3Setting verifies that "8dot3 name creation" flags // are set to 2 and 0, if enabled parameter is true, or 2 and 1, if enabled // is false. Otherwise checkVolume8dot3Setting returns error. diff --git a/src/path/filepath/symlink_windows.go b/src/path/filepath/symlink_windows.go index d72279e2bb..9a436d5978 100644 --- a/src/path/filepath/symlink_windows.go +++ b/src/path/filepath/symlink_windows.go @@ -49,11 +49,12 @@ func baseIsDotDot(path string) bool { // toNorm returns the normalized path that is guaranteed to be unique. // It should accept the following formats: -// * UNC paths (e.g \\server\share\foo\bar) -// * absolute paths (e.g C:\foo\bar) -// * relative paths begin with drive letter (e.g C:foo\bar, C:..\foo\bar, C:.., C:.) -// * relative paths begin with '\' (e.g \foo\bar) -// * relative paths begin without '\' (e.g foo\bar, ..\foo\bar, .., .) +// - UNC paths (e.g \\server\share\foo\bar) +// - absolute paths (e.g C:\foo\bar) +// - relative paths begin with drive letter (e.g C:foo\bar, C:..\foo\bar, C:.., C:.) +// - relative paths begin with '\' (e.g \foo\bar) +// - relative paths begin without '\' (e.g foo\bar, ..\foo\bar, .., .) +// // The returned normalized path will be in the same form (of 5 listed above) as the input path. // If two paths A and B are indicating the same file with the same format, toNorm(A) should be equal to toNorm(B). // The normBase parameter should be equal to the normBase func, except for in tests. See docs on the normBase func. diff --git a/src/path/path.go b/src/path/path.go index 5c5bc445ac..547b9debce 100644 --- a/src/path/path.go +++ b/src/path/path.go @@ -52,12 +52,12 @@ func (b *lazybuf) string() string { // by purely lexical processing. It applies the following rules // iteratively until no further processing can be done: // -// 1. Replace multiple slashes with a single slash. -// 2. Eliminate each . path name element (the current directory). -// 3. Eliminate each inner .. path name element (the parent directory) -// along with the non-.. element that precedes it. -// 4. Eliminate .. elements that begin a rooted path: -// that is, replace "/.." by "/" at the beginning of a path. +// 1. Replace multiple slashes with a single slash. +// 2. Eliminate each . path name element (the current directory). +// 3. Eliminate each inner .. path name element (the parent directory) +// along with the non-.. element that precedes it. +// 4. Eliminate .. elements that begin a rooted path: +// that is, replace "/.." by "/" at the beginning of a path. // // The returned path ends in a slash only if it is the root "/". // |