Skip to content

Commit a616066

Browse files
committed
runtime/debug: stack test fail when GOROOT='/usr/local/go/'
Fixes: #65506 Signed-off-by: guoguangwu <[email protected]>
1 parent 117164f commit a616066

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/runtime/debug/stack_test.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ func TestStack(t *testing.T) {
105105
}
106106
filePrefix := ""
107107
if fileGoroot != "" {
108-
filePrefix = filepath.ToSlash(fileGoroot) + "/src/"
108+
fileGoroot = filepath.ToSlash(filepath.Clean(fileGoroot))
109+
if fileGoroot == "/" {
110+
filePrefix = "/src/"
111+
} else {
112+
filePrefix = fileGoroot + "/src/"
113+
}
109114
}
110115

111116
n := 0

0 commit comments

Comments
 (0)