chore: replace gopkg.in/yaml.v3 vs goccy/go-yaml; replace encoding/json with bytedance/sonic

This commit is contained in:
yusing
2025-04-16 14:17:57 +08:00
parent 104e1b1d0a
commit c286275f7e
10 changed files with 40 additions and 9 deletions

View File

@@ -4,9 +4,9 @@ import (
"testing"
"github.com/go-acme/lego/v4/providers/dns/ovh"
"github.com/goccy/go-yaml"
"github.com/yusing/go-proxy/internal/utils"
. "github.com/yusing/go-proxy/internal/utils/testing"
"gopkg.in/yaml.v3"
)
// type Config struct {

View File

@@ -5,6 +5,7 @@ import (
"path"
"testing"
"github.com/goccy/go-yaml"
"github.com/stretchr/testify/assert"
"github.com/yusing/go-proxy/agent/pkg/agent"
"github.com/yusing/go-proxy/internal/common"
@@ -12,7 +13,6 @@ import (
"github.com/yusing/go-proxy/internal/route/provider"
"github.com/yusing/go-proxy/internal/utils"
. "github.com/yusing/go-proxy/internal/utils/testing"
"gopkg.in/yaml.v3"
)
func TestFileProviderValidate(t *testing.T) {

View File

@@ -6,8 +6,8 @@ import (
"path"
"sort"
"github.com/goccy/go-yaml"
"github.com/yusing/go-proxy/internal/gperr"
"gopkg.in/yaml.v3"
)
var ErrMissingMiddlewareUse = gperr.New("missing middleware 'use' field")

View File

@@ -5,6 +5,7 @@ import (
"strconv"
"github.com/docker/docker/client"
"github.com/goccy/go-yaml"
"github.com/rs/zerolog"
"github.com/yusing/go-proxy/internal/common"
"github.com/yusing/go-proxy/internal/docker"
@@ -14,7 +15,6 @@ import (
U "github.com/yusing/go-proxy/internal/utils"
"github.com/yusing/go-proxy/internal/utils/strutils"
"github.com/yusing/go-proxy/internal/watcher"
"gopkg.in/yaml.v3"
)
type DockerProvider struct {

View File

@@ -4,9 +4,9 @@ import (
"testing"
"github.com/docker/docker/api/types"
"github.com/goccy/go-yaml"
"github.com/yusing/go-proxy/internal/docker"
. "github.com/yusing/go-proxy/internal/utils/testing"
"gopkg.in/yaml.v3"
_ "embed"
)

View File

@@ -3,8 +3,8 @@ package functional
import (
"sync"
"github.com/goccy/go-yaml"
"github.com/puzpuzpuz/xsync/v3"
"gopkg.in/yaml.v3"
)
type Map[KT comparable, VT any] struct {

View File

@@ -13,10 +13,10 @@ import (
"time"
"github.com/go-playground/validator/v10"
"github.com/goccy/go-yaml"
"github.com/yusing/go-proxy/internal/gperr"
"github.com/yusing/go-proxy/internal/utils/functional"
"github.com/yusing/go-proxy/internal/utils/strutils"
"gopkg.in/yaml.v3"
)
type SerializedObject = map[string]any

View File

@@ -8,8 +8,8 @@ import (
"strconv"
"testing"
"github.com/goccy/go-yaml"
. "github.com/yusing/go-proxy/internal/utils/testing"
"gopkg.in/yaml.v3"
)
func TestUnmarshal(t *testing.T) {