Skip to content

Commit

Permalink
Changed JSON encoder from encoding/json to json-iterator/go
Browse files Browse the repository at this point in the history
- Reasons can be found in PR #1245
Signed-off-by: Neil Naveen <42328488+neilnaveen@users.noreply.github.com>

Signed-off-by: Neil Naveen <42328488+neilnaveen@users.noreply.github.com>
  • Loading branch information
neilnaveen committed Sep 11, 2023
1 parent 0268d1a commit ad324e4
Show file tree
Hide file tree
Showing 64 changed files with 121 additions and 64 deletions.
3 changes: 2 additions & 1 deletion cmd/guacone/cmd/collectsub_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package cmd

import (
"context"
"encoding/json"
"fmt"
"io"
"os"

json "github.com/json-iterator/go"

"github.com/guacsec/guac/pkg/cli"
"github.com/guacsec/guac/pkg/collectsub/client"
"github.com/guacsec/guac/pkg/collectsub/collectsub"
Expand Down
3 changes: 2 additions & 1 deletion internal/testing/cmd/pubsub_test/cmd/files.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ package cmd

import (
"context"
"encoding/json"
"fmt"
"os"
"sync"
"time"

json "github.com/json-iterator/go"

"github.com/guacsec/guac/pkg/assembler"
"github.com/guacsec/guac/pkg/emitter"
"github.com/guacsec/guac/pkg/handler/collector"
Expand Down
3 changes: 2 additions & 1 deletion internal/testing/cmd/pubsub_test/cmd/osv.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ package cmd

import (
"context"
"encoding/json"
"fmt"
"net/http"
"os"
"sync"
"time"

json "github.com/json-iterator/go"

"github.com/Khan/genqlient/graphql"
"github.com/guacsec/guac/pkg/assembler"
"github.com/guacsec/guac/pkg/certifier"
Expand Down
3 changes: 2 additions & 1 deletion internal/testing/dochelper/dochelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@
package dochelper

import (
"encoding/json"
"fmt"
"reflect"
"time"

json "github.com/json-iterator/go"

attestation_vuln "github.com/guacsec/guac/pkg/certifier/attestation"
"github.com/guacsec/guac/pkg/handler/processor"
)
Expand Down
3 changes: 2 additions & 1 deletion internal/testing/testdata/testdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ package testdata
import (
_ "embed"
"encoding/base64"
"encoding/json"
"time"

json "github.com/json-iterator/go"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/guacsec/guac/internal/testing/keyutil"
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/assembler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package assembler

import (
"context"
"encoding/json"
"fmt"
"testing"
"time"

json "github.com/json-iterator/go"

"github.com/google/go-cmp/cmp"
"github.com/google/go-cmp/cmp/cmpopts"
"github.com/guacsec/guac/internal/testing/ptrfrom"
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/artifact.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/certifyBad.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/certifyGood.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/certifyScorecard.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"sort"
"strconv"
"strings"
"time"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/certifyVEXStatement.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"
"time"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/certifyVuln.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"
"time"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/internal/testing/ptrfrom"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/hasSBOM.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/hasSLSA.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"sort"
"strings"
"time"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/hashEqual.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"sort"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/isDependency.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/isOccurrence.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/pkg.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"sort"
"strings"

json "github.com/json-iterator/go"

"github.com/99designs/gqlgen/graphql"
"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/pkgEqual.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"sort"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
purl "github.com/package-url/packageurl-go"
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/src.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"

json "github.com/json-iterator/go"

"github.com/99designs/gqlgen/graphql"
"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/vulnEqual.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"sort"
"strings"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/internal/testing/ptrfrom"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/vulnMetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,12 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"
"time"

json "github.com/json-iterator/go"

"github.com/arangodb/go-driver"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
)
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/arangodb/vulnerability.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package arangodb

import (
"context"
"encoding/json"
"fmt"
"strings"

json "github.com/json-iterator/go"

"github.com/99designs/gqlgen/graphql"
"github.com/arangodb/go-driver"
"github.com/guacsec/guac/internal/testing/ptrfrom"
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/ent/backend/pkgequal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@
package backend

import (
"encoding/json"
"strconv"

json "github.com/json-iterator/go"

"github.com/google/go-cmp/cmp"
"github.com/guacsec/guac/internal/testing/ptrfrom"
"github.com/guacsec/guac/pkg/assembler/graphql/model"
Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/inmem/isOccurrence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package inmem_test

import (
"context"
"encoding/json"
"strings"
"testing"

json "github.com/json-iterator/go"

"github.com/google/go-cmp/cmp"
"golang.org/x/exp/slices"

Expand Down
3 changes: 2 additions & 1 deletion pkg/assembler/backends/neptune/neptune.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ package neptune

import (
"context"
"encoding/json"
"fmt"
"net/http"
"os"
"time"

json "github.com/json-iterator/go"

"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
v4 "github.com/aws/aws-sdk-go/aws/signer/v4"
Expand Down
3 changes: 2 additions & 1 deletion pkg/certifier/certify/certify.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ package certify

import (
"context"
"encoding/json"
"fmt"
"time"

json "github.com/json-iterator/go"

"github.com/guacsec/guac/pkg/certifier"
"github.com/guacsec/guac/pkg/emitter"
"github.com/guacsec/guac/pkg/handler/processor"
Expand Down
3 changes: 2 additions & 1 deletion pkg/certifier/certify/certify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ package certify

import (
"context"
"encoding/json"
"errors"
"fmt"
"testing"
"time"

json "github.com/json-iterator/go"

uuid "github.com/gofrs/uuid"
"github.com/guacsec/guac/internal/testing/dochelper"
nats_test "github.com/guacsec/guac/internal/testing/nats"
Expand Down
Loading

0 comments on commit ad324e4

Please sign in to comment.