Skip to content

Commit

Permalink
Use goccy/go-json instead of encoding/json (#1383)
Browse files Browse the repository at this point in the history
  • Loading branch information
hariso authored Feb 15, 2024
1 parent d1e0cdc commit b65713a
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ linters-settings:
- pkg: golang.org/x/xerrors
desc: To accommodate for custom error creation and handling use Conduit's 'cerrors' package instead.
- pkg: github.com/golang/mock
desc: github.com/golang/mock is deprecated, use go.uber.org/mock instead
desc: github.com/golang/mock is deprecated, use go.uber.org/mock instead.
- pkg: encoding/json
desc: github.com/goccy/go-json is preferred for performance reasons.
gofmt:
simplify: false
govet:
Expand Down
2 changes: 1 addition & 1 deletion pkg/foundation/grpcutil/interceptor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ package grpcutil
import (
"bytes"
"context"
"encoding/json"
"testing"

"github.com/conduitio/conduit/pkg/foundation/ctxutil"
"github.com/conduitio/conduit/pkg/foundation/log"
"github.com/goccy/go-json"
"github.com/google/uuid"
"github.com/matryer/is"
"github.com/rs/zerolog"
Expand Down
2 changes: 1 addition & 1 deletion pkg/pipeline/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ package pipeline
import (
"bytes"
"context"
"encoding/json"
"strings"

"github.com/conduitio/conduit/pkg/foundation/cerrors"
"github.com/conduitio/conduit/pkg/foundation/database"
"github.com/goccy/go-json"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/processor/procbuiltin/httprequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ package procbuiltin
import (
"bytes"
"context"
"encoding/json"
"io"
"net/http"
"net/url"
Expand All @@ -26,6 +25,7 @@ import (
"github.com/conduitio/conduit/pkg/foundation/cerrors"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/goccy/go-json"
"github.com/jpillora/backoff"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/processor/procbuiltin/httprequest_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ package procbuiltin

import (
"context"
"encoding/json"
"io"
"net/http"
"net/http/httptest"
"testing"

"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/goccy/go-json"
"github.com/matryer/is"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/processor/procbuiltin/parsejson.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ package procbuiltin

import (
"context"
"encoding/json"

"github.com/conduitio/conduit/pkg/foundation/cerrors"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/goccy/go-json"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/processor/procbuiltin/unwrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ package procbuiltin
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"time"

"github.com/conduitio/conduit/pkg/foundation/cerrors"
"github.com/conduitio/conduit/pkg/foundation/multierror"
"github.com/conduitio/conduit/pkg/processor"
"github.com/conduitio/conduit/pkg/record"
"github.com/goccy/go-json"
)

type unwrapProcessor struct {
Expand Down
2 changes: 1 addition & 1 deletion pkg/processor/schemaregistry/client_fake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
package schemaregistry

import (
"encoding/json"
"net/http"
"net/http/httptest"
"strconv"
Expand All @@ -27,6 +26,7 @@ import (

"github.com/conduitio/conduit/pkg/foundation/cerrors"
"github.com/conduitio/conduit/pkg/processor/schemaregistry/internal"
"github.com/goccy/go-json"
"github.com/lovromazgon/franz-go/pkg/sr"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/processor/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ package processor
import (
"bytes"
"context"
"encoding/json"
"strings"

"github.com/conduitio/conduit/pkg/foundation/cerrors"
"github.com/conduitio/conduit/pkg/foundation/database"
"github.com/goccy/go-json"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/provisioning/config/yaml/v2/model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
package v2

import (
"encoding/json"
"testing"

"github.com/goccy/go-json"
"github.com/matryer/is"
)

Expand Down
2 changes: 1 addition & 1 deletion pkg/record/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ package record
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"strconv"
"strings"

"github.com/conduitio/conduit/pkg/foundation/cerrors"
"github.com/conduitio/conduit/pkg/record/schema"
"github.com/goccy/go-json"
)

const (
Expand Down

0 comments on commit b65713a

Please sign in to comment.