Skip to content

Commit

Permalink
changed to use github.com/goccy/go-json instead of std-lib-json
Browse files Browse the repository at this point in the history
  • Loading branch information
wiremanb committed Dec 6, 2023
1 parent b6fae9b commit 1487a40
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion page_shield.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cloudflare

import (
"context"
"encoding/json"
"fmt"
"github.com/goccy/go-json"

Check failure on line 6 in page_shield.go

View workflow job for this annotation

GitHub Actions / lint

File is not `goimports`-ed (goimports)
"net/http"
)

Expand Down
2 changes: 1 addition & 1 deletion page_shield_connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cloudflare

import (
"context"
"encoding/json"
"fmt"
"github.com/goccy/go-json"
"net/http"
)

Expand Down
2 changes: 1 addition & 1 deletion page_shield_connections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cloudflare

import (
"context"
"encoding/json"
"fmt"
"github.com/goccy/go-json"
"net/http"
"testing"

Expand Down
2 changes: 1 addition & 1 deletion page_shield_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cloudflare

import (
"context"
"encoding/json"
"fmt"
"github.com/goccy/go-json"
"net/http"
)

Expand Down
4 changes: 1 addition & 3 deletions page_shield_policies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ package cloudflare

import (
"context"
"encoding/json"
"fmt"
"github.com/goccy/go-json"
"net/http"
"testing"

"github.com/stretchr/testify/assert"
)

// Mock data for PageShieldPolicies
var mockPageShieldPolicies = []PageShieldPolicy{
{
Action: "allow",
Expand Down Expand Up @@ -51,7 +50,6 @@ func TestListPageShieldPolicies(t *testing.T) {
json.NewEncoder(w).Encode(response)

Check failure on line 50 in page_shield_policies_test.go

View workflow job for this annotation

GitHub Actions / lint

Error return value of `(*github.com/goccy/go-json.Encoder).Encode` is not checked (errcheck)
})

// Test
result, _, err := client.ListPageShieldPolicies(context.Background(), &ResourceContainer{Identifier: "testzone"})
assert.NoError(t, err)
assert.Equal(t, mockPageShieldPolicies, result)
Expand Down
2 changes: 1 addition & 1 deletion page_shield_scripts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package cloudflare

import (
"context"
"encoding/json"
"fmt"
"github.com/goccy/go-json"
"net/http"
)

Expand Down
3 changes: 1 addition & 2 deletions page_shield_scripts_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@ package cloudflare

import (
"context"
"encoding/json"
"fmt"
"github.com/goccy/go-json"
"net/http"
"testing"

"github.com/stretchr/testify/assert"
)

// Mock data
var mockPageShieldScripts = []PageShieldScript{
{
AddedAt: "2021-08-18T10:51:10.09615Z",
Expand Down

0 comments on commit 1487a40

Please sign in to comment.