aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/runtime/metrics/description_test.go16
1 files changed, 3 insertions, 13 deletions
diff --git a/src/runtime/metrics/description_test.go b/src/runtime/metrics/description_test.go
index e966a281a1..448639ee77 100644
--- a/src/runtime/metrics/description_test.go
+++ b/src/runtime/metrics/description_test.go
@@ -7,9 +7,7 @@ package metrics_test
import (
"bufio"
"os"
- "path/filepath"
"regexp"
- "runtime"
"runtime/metrics"
"strings"
"testing"
@@ -26,17 +24,9 @@ func TestDescriptionNameFormat(t *testing.T) {
}
func extractMetricDocs(t *testing.T) map[string]string {
- if runtime.GOOS == "android" {
- t.Skip("no access to Go source on android")
- }
-
- // Get doc.go.
- _, filename, _, _ := runtime.Caller(0)
- filename = filepath.Join(filepath.Dir(filename), "doc.go")
-
- f, err := os.Open(filename)
+ f, err := os.Open("doc.go")
if err != nil {
- t.Fatal(err)
+ t.Fatalf("failed to open doc.go in runtime/metrics package: %v", err)
}
const (
stateSearch = iota // look for list of metrics
@@ -90,7 +80,7 @@ func extractMetricDocs(t *testing.T) map[string]string {
}
}
if state == stateSearch {
- t.Fatalf("failed to find supported metrics docs in %s", filename)
+ t.Fatalf("failed to find supported metrics docs in %s", f.Name())
}
return result
}