aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing.go')
-rw-r--r--src/testing/testing.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/testing/testing.go b/src/testing/testing.go
index 1bc8aff00d..d89a99454d 100644
--- a/src/testing/testing.go
+++ b/src/testing/testing.go
@@ -771,9 +771,7 @@ func (c *common) decorate(s string, skip int) string {
if file != "" {
if *fullPath {
// If relative path, truncate file name at last file name separator.
- } else if index := strings.LastIndex(file, "/"); index >= 0 {
- file = file[index+1:]
- } else if index = strings.LastIndex(file, "\\"); index >= 0 {
+ } else if index := strings.LastIndexAny(file, `/\`); index >= 0 {
file = file[index+1:]
}
} else {