Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

replace encoding/json with github.com/goccy/go-json #1360

Merged
merged 3 commits into from
Aug 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changelog/1360.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
```release-note:enhancement
cloudflare: swap `encoding/json` for `github.com/goccy/go-json`
```

```release-note:bug
cache_purge: don't escape HTML entity values in URLs for cache keys
```
3 changes: 2 additions & 1 deletion access_application.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// AccessApplicationType represents the application type.
Expand Down
3 changes: 2 additions & 1 deletion access_audit_log.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package cloudflare

import (
"context"
"encoding/json"
"fmt"
"net/http"
"net/url"
"strconv"
"time"

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

// AccessAuditLogRecord is the structure of a single Access Audit Log entry.
Expand Down
3 changes: 2 additions & 1 deletion access_audit_log_example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare_test

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

"github.com/goccy/go-json"

cloudflare "github.com/cloudflare/cloudflare-go"
)

Expand Down
3 changes: 2 additions & 1 deletion access_bookmark.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// AccessBookmark represents an Access bookmark application.
Expand Down
3 changes: 2 additions & 1 deletion access_ca_certificate.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package cloudflare

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

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

// AccessCACertificate is the structure of the CA certificate used for
Expand Down
3 changes: 2 additions & 1 deletion access_custom_page.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"

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

var ErrMissingUID = errors.New("required UID missing")
Expand Down
3 changes: 2 additions & 1 deletion access_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// AccessGroup defines a group for allowing or disallowing access to
Expand Down
3 changes: 2 additions & 1 deletion access_identity_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package cloudflare

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

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

// AccessIdentityProvider is the structure of the provider object.
Expand Down
3 changes: 2 additions & 1 deletion access_keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

type AccessKeysConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion access_keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ package cloudflare

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

"github.com/goccy/go-json"
"github.com/stretchr/testify/assert"
)

Expand Down
3 changes: 2 additions & 1 deletion access_mutual_tls_certificates.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// AccessMutualTLSCertificate is the structure of a single Access Mutual TLS
Expand Down
3 changes: 2 additions & 1 deletion access_organization.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// AccessOrganization represents an Access organization.
Expand Down
3 changes: 2 additions & 1 deletion access_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package cloudflare

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

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

var (
Expand Down
3 changes: 2 additions & 1 deletion access_service_tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@ package cloudflare

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

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

var (
Expand Down
3 changes: 2 additions & 1 deletion account_members.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

import (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"

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

// AccountMember is the definition of a member of an account.
Expand Down
3 changes: 2 additions & 1 deletion account_roles.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package cloudflare

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

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

// AccountRole defines the roles that a member can have attached.
Expand Down
3 changes: 2 additions & 1 deletion accounts.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// AccountSettings outlines the available options for an account.
Expand Down
3 changes: 2 additions & 1 deletion addressing_address_map.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// AddressMap contains information about an address map.
Expand Down
3 changes: 2 additions & 1 deletion addressing_ip_prefix.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// IPPrefix contains information about an IP prefix.
Expand Down
3 changes: 2 additions & 1 deletion api_shield.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ package cloudflare

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

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

// AuthIdCharacteristics a single option from
Expand Down
3 changes: 2 additions & 1 deletion api_token.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// APIToken is the full API token.
Expand Down
3 changes: 2 additions & 1 deletion argo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

var validSettingValues = []string{"on", "off"}
Expand Down
3 changes: 2 additions & 1 deletion argo_tunnel.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// ArgoTunnel is the struct definition of a tunnel.
Expand Down
3 changes: 2 additions & 1 deletion auditlogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ package cloudflare

import (
"context"
"encoding/json"
"net/http"
"net/url"
"path"
"strconv"
"time"

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

// AuditLogAction is a member of AuditLog, the action that was taken.
Expand Down
3 changes: 2 additions & 1 deletion authenticated_origin_pulls.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// AuthenticatedOriginPulls represents global AuthenticatedOriginPulls (tls_client_auth) metadata.
Expand Down
3 changes: 2 additions & 1 deletion authenticated_origin_pulls_per_hostname.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// PerHostnameAuthenticatedOriginPullsCertificateDetails represents the metadata for a Per Hostname AuthenticatedOriginPulls certificate.
Expand Down
3 changes: 2 additions & 1 deletion authenticated_origin_pulls_per_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// PerZoneAuthenticatedOriginPullsSettings represents the settings for Per Zone AuthenticatedOriginPulls.
Expand Down
3 changes: 2 additions & 1 deletion cache_reserve.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// CacheReserve is the structure of the API object for the cache reserve
Expand Down
3 changes: 2 additions & 1 deletion certificate_packs.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cloudflare

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

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

// CertificatePackGeoRestrictions is for the structure of the geographic
Expand Down