From 373ab344925b6fdcb78bed0ccfe0238e9f6d837e Mon Sep 17 00:00:00 2001 From: Daz Wilkin Date: Fri, 5 May 2023 07:45:28 -0700 Subject: [PATCH] Add dummy package for `runtime/metrics` to that modules that depend upon it (e.g. [Prometheus Go client library](https://github.com/prometheus/client_golang/blob/main/prometheus/internal/go_runtime_metrics.go)) will compile. Avoids: ```console package runtime/metrics is not in GOROOT ``` Fixes #3705 --- src/runtime/metrics/metrics.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/runtime/metrics/metrics.go diff --git a/src/runtime/metrics/metrics.go b/src/runtime/metrics/metrics.go new file mode 100644 index 00000000..00108f84 --- /dev/null +++ b/src/runtime/metrics/metrics.go @@ -0,0 +1,32 @@ +// Package metrics is a dummy package that is not yet implemented. + +package metrics + +type Description struct{} + +func All() []Description { + return nil +} + +type Float64Histogram struct{} + +type Sample struct{} + +func Read(m []Sample) {} + +type Value struct{} + +func (v Value) Float64() float64 { + return 0 +} +func (v Value) Float64Histogram() *Float64Histogram { + return nil +} +func (v Value) Kind() ValueKind { + return ValueKind{} +} +func (v Value) Uint64() uint64 { + return 0 +} + +type ValueKind struct{}