From 36242904f1200568c0f65e91c78280d509c490f0 Mon Sep 17 00:00:00 2001 From: Joe Tsai Date: Thu, 21 Sep 2023 14:19:27 -0700 Subject: [PATCH] go.mod: update github.com/go-json-experiment/json (#9508) Update github.com/go-json-experiment/json to the latest version and fix the build in light of some breaking API changes. Updates #cleanup Signed-off-by: Joe Tsai --- cmd/netlogfmt/main.go | 9 +++++---- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/cmd/netlogfmt/main.go b/cmd/netlogfmt/main.go index 98c958305..e1a5c2cb2 100644 --- a/cmd/netlogfmt/main.go +++ b/cmd/netlogfmt/main.go @@ -42,6 +42,7 @@ import ( "github.com/dsnet/try" jsonv2 "github.com/go-json-experiment/json" + "github.com/go-json-experiment/json/jsontext" "tailscale.com/types/logid" "tailscale.com/types/netlogtype" "tailscale.com/util/cmpx" @@ -75,13 +76,13 @@ func main() { func processStream(r io.Reader) (err error) { defer try.Handle(&err) - dec := jsonv2.NewDecoder(os.Stdin) + dec := jsontext.NewDecoder(os.Stdin) for { processValue(dec) } } -func processValue(dec *jsonv2.Decoder) { +func processValue(dec *jsontext.Decoder) { switch dec.PeekKind() { case '[': processArray(dec) @@ -92,7 +93,7 @@ func processValue(dec *jsonv2.Decoder) { } } -func processArray(dec *jsonv2.Decoder) { +func processArray(dec *jsontext.Decoder) { try.E1(dec.ReadToken()) // parse '[' for dec.PeekKind() != ']' { processValue(dec) @@ -100,7 +101,7 @@ func processArray(dec *jsonv2.Decoder) { try.E1(dec.ReadToken()) // parse ']' } -func processObject(dec *jsonv2.Decoder) { +func processObject(dec *jsontext.Decoder) { var hasTraffic bool var rawMsg []byte try.E1(dec.ReadToken()) // parse '{' diff --git a/go.mod b/go.mod index 205d10ecb..127ee7483 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/evanw/esbuild v0.14.53 github.com/frankban/quicktest v1.14.5 github.com/fxamacker/cbor/v2 v2.4.0 - github.com/go-json-experiment/json v0.0.0-20230321051131-ccbac49a6929 + github.com/go-json-experiment/json v0.0.0-20230908182459-f320be06fe37 github.com/go-logr/zapr v1.2.4 github.com/go-ole/go-ole v1.2.6 github.com/godbus/dbus/v5 v5.1.1-0.20230522191255-76236955d466 diff --git a/go.sum b/go.sum index 3b02cfe6a..5a19bbe32 100644 --- a/go.sum +++ b/go.sum @@ -299,8 +299,8 @@ github.com/go-git/go-git/v5 v5.7.0/go.mod h1:coJHKEOk5kUClpsNlXrUvPrDxY3w3gjHvhc github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= -github.com/go-json-experiment/json v0.0.0-20230321051131-ccbac49a6929 h1:GdbUZo0+623j+pKRhwwdf1q28IUgRc7asx3TjF9b7VQ= -github.com/go-json-experiment/json v0.0.0-20230321051131-ccbac49a6929/go.mod h1:AHV+bpNGVGD0DCHMBhhTYtT7yeBYD9Yk92XAjB7vOgo= +github.com/go-json-experiment/json v0.0.0-20230908182459-f320be06fe37 h1:JFXgl/SzxYP9ULDFS97xkKB/Bfdywrc3rre1nYEwMj8= +github.com/go-json-experiment/json v0.0.0-20230908182459-f320be06fe37/go.mod h1:6daplAwHHGbUGib4990V3Il26O0OC4aRyvewaaAihaA= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY=