From b03242d7ab98645d2c936e1899aac9f0aeb9813e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 10:41:17 +0000 Subject: mod: do: bump github.com/prometheus/client_golang from 1.14.0 to 1.16.0 Bumps [github.com/prometheus/client_golang](https://github.com/prometheus/client_golang) from 1.14.0 to 1.16.0. - [Release notes](https://github.com/prometheus/client_golang/releases) - [Changelog](https://github.com/prometheus/client_golang/blob/main/CHANGELOG.md) - [Commits](https://github.com/prometheus/client_golang/compare/v1.14.0...v1.16.0) --- updated-dependencies: - dependency-name: github.com/prometheus/client_golang dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- .../prometheus/common/model/value_float.go | 27 ++++++++-------------- 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'vendor/github.com/prometheus/common/model/value_float.go') diff --git a/vendor/github.com/prometheus/common/model/value_float.go b/vendor/github.com/prometheus/common/model/value_float.go index 8b59571a3..0f615a705 100644 --- a/vendor/github.com/prometheus/common/model/value_float.go +++ b/vendor/github.com/prometheus/common/model/value_float.go @@ -18,15 +18,8 @@ import ( "fmt" "math" "strconv" - "unsafe" - - jsoniter "github.com/json-iterator/go" ) -func init() { - jsoniter.RegisterTypeEncoderFunc("model.SamplePair", marshalSamplePairJSON, marshalJSONIsEmpty) -} - var ( // ZeroSamplePair is the pseudo zero-value of SamplePair used to signal a // non-existing sample pair. It is a SamplePair with timestamp Earliest and @@ -78,18 +71,16 @@ type SamplePair struct { Value SampleValue } -// marshalSamplePairJSON writes `[ts, "val"]`. -func marshalSamplePairJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) { - p := *((*SamplePair)(ptr)) - stream.WriteArrayStart() - MarshalTimestamp(int64(p.Timestamp), stream) - stream.WriteMore() - MarshalValue(float64(p.Value), stream) - stream.WriteArrayEnd() -} - func (s SamplePair) MarshalJSON() ([]byte, error) { - return jsoniter.ConfigCompatibleWithStandardLibrary.Marshal(s) + t, err := json.Marshal(s.Timestamp) + if err != nil { + return nil, err + } + v, err := json.Marshal(s.Value) + if err != nil { + return nil, err + } + return []byte(fmt.Sprintf("[%s,%s]", t, v)), nil } // UnmarshalJSON implements json.Unmarshaler. -- cgit mrf-deployment