Standard library / runtime/metrics

metrics.Value.Kind()

Reports the tag of the value. Check it before invoking typed accessors. Expected stdout: 'true\n'.

Formal Syntax & Structure

go syntaxgo
func (v Value) Kind() ValueKind

Return Value

ValueKind

Representation tag for the value.

Working Example

Example Snippetgo
package main
import (  "fmt"  "runtime/metrics")
func main() {  s := []metrics.Sample{{Name: "/gc/heap/allocs:bytes"}}  metrics.Read(s)  fmt.Println(s[0].Value.Kind() == metrics.KindUint64)}
Go Reference