forked from toolshed/abra
chore: deps and vendor
This commit is contained in:
3
vendor/github.com/prometheus/common/model/value_float.go
generated
vendored
3
vendor/github.com/prometheus/common/model/value_float.go
generated
vendored
@ -15,6 +15,7 @@ package model
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"math"
|
||||
"strconv"
|
||||
@ -39,7 +40,7 @@ func (v SampleValue) MarshalJSON() ([]byte, error) {
|
||||
// UnmarshalJSON implements json.Unmarshaler.
|
||||
func (v *SampleValue) UnmarshalJSON(b []byte) error {
|
||||
if len(b) < 2 || b[0] != '"' || b[len(b)-1] != '"' {
|
||||
return fmt.Errorf("sample value must be a quoted string")
|
||||
return errors.New("sample value must be a quoted string")
|
||||
}
|
||||
f, err := strconv.ParseFloat(string(b[1:len(b)-1]), 64)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user