Skip to content

Commit ce99fca

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

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/runtime/debug/stack_test.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,11 @@ func TestStack(t *testing.T) {
105105
}
106106
filePrefix := ""
107107
if fileGoroot != "" {
108-
filePrefix = filepath.ToSlash(fileGoroot) + "/src/"
108+
fileGoroot = filepath.ToSlash(fileGoroot)
109+
if strings.HasSuffix(fileGoroot, "/") {
110+
fileGoroot = fileGoroot[:len(fileGoroot)-1]
111+
}
112+
filePrefix = fileGoroot + "/src/"
109113
}
110114

111115
n := 0

0 commit comments

Comments
 (0)