aboutsummaryrefslogtreecommitdiff
path: root/src/internal
diff options
context:
space:
mode:
authorDavid du Colombier <0intro@gmail.com>2022-12-07 15:20:25 +0100
committerDavid du Colombier <0intro@gmail.com>2022-12-07 23:52:46 +0000
commit9431237d772f4a3b670f8533868d6df0488688a9 (patch)
treefc65216cb61b063caaf3c9df414ffa77a9ae6d1c /src/internal
parent7c7cd56870ba617f964014fa4694e9b61e29cf97 (diff)
downloadgo-9431237d772f4a3b670f8533868d6df0488688a9.tar.xz
internal/safefilepath: fix TestFromFS on Plan 9
CL 455716 added TestFromFS. This test was failing on Plan 9 because fromFS didn't return an empty string in case of error. This change fixes TestFromFS by returning an empty string in case of error. Fixes #57142. Change-Id: Ie50dfba5e70154d641f762fa43f1c26c3d12b6f6 Reviewed-on: https://go-review.googlesource.com/c/go/+/455835 TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Damien Neil <dneil@google.com> Run-TryBot: David du Colombier <0intro@gmail.com>
Diffstat (limited to 'src/internal')
-rw-r--r--src/internal/safefilepath/path_other.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/internal/safefilepath/path_other.go b/src/internal/safefilepath/path_other.go
index f93da18680..974e7751a2 100644
--- a/src/internal/safefilepath/path_other.go
+++ b/src/internal/safefilepath/path_other.go
@@ -11,7 +11,7 @@ import "runtime"
func fromFS(path string) (string, error) {
if runtime.GOOS == "plan9" {
if len(path) > 0 && path[0] == '#' {
- return path, errInvalidPath
+ return "", errInvalidPath
}
}
for i := range path {