From 9431237d772f4a3b670f8533868d6df0488688a9 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Wed, 7 Dec 2022 15:20:25 +0100 Subject: [PATCH] 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 Reviewed-by: Ian Lance Taylor Reviewed-by: Damien Neil Run-TryBot: David du Colombier <0intro@gmail.com> --- src/internal/safefilepath/path_other.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {