MCPcopy Create free account
hub / github.com/prometheus/common / UnmarshalJSON

Method UnmarshalJSON

model/value_histogram.go:33–43  ·  view source on GitHub ↗
(b []byte)

Source from the content-addressed store, hash-verified

31}
32
33func (v *FloatString) UnmarshalJSON(b []byte) error {
34 if len(b) < 2 || b[0] != '"' || b[len(b)-1] != '"' {
35 return fmt.Errorf("float value must be a quoted string")
36 }
37 f, err := strconv.ParseFloat(string(b[1:len(b)-1]), 64)
38 if err != nil {
39 return err
40 }
41 *v = FloatString(f)
42 return nil
43}
44
45type HistogramBucket struct {
46 Boundaries int32

Callers

nothing calls this directly

Calls 1

FloatStringTypeAlias · 0.85

Tested by

no test coverage detected