From d80db84adb716b2db2b4800d67e549c68539d0b2 Mon Sep 17 00:00:00 2001 From: Jacky Date: Sat, 14 Dec 2024 17:36:48 +0800 Subject: [PATCH] chore(deps): update orderedmap to v3 --- go.mod | 2 +- go.sum | 3 +-- settings/server_v1.go | 8 ++++---- settings/settings.go | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index 1f8f3f27..12104cef 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,6 @@ require ( github.com/creack/pty v1.1.24 github.com/dgraph-io/ristretto/v2 v2.0.1 github.com/dustin/go-humanize v1.0.1 - github.com/elliotchance/orderedmap/v2 v2.6.0 github.com/elliotchance/orderedmap/v3 v3.0.0 github.com/fatih/color v1.18.0 github.com/gin-contrib/static v1.1.2 @@ -107,6 +106,7 @@ require ( github.com/dimchansky/utfbom v1.1.1 // indirect github.com/dnsimple/dnsimple-go v1.7.0 // indirect github.com/ebitengine/purego v0.8.1 // indirect + github.com/elliotchance/orderedmap/v2 v2.5.0 // indirect github.com/exoscale/egoscale/v3 v3.1.7 // indirect github.com/fatih/structs v1.1.0 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect diff --git a/go.sum b/go.sum index 1d2d9fec..801d5d7f 100644 --- a/go.sum +++ b/go.sum @@ -858,8 +858,7 @@ github.com/ebitengine/purego v0.8.1/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/elliotchance/orderedmap/v2 v2.5.0 h1:WRPmWGChucaZ09eEd3UkU8XfVajv6ZZ6eg3+x0cLWPM= github.com/elliotchance/orderedmap/v2 v2.5.0/go.mod h1:85lZyVbpGaGvHvnKa7Qhx7zncAdBIBq6u56Hb1PRU5Q= -github.com/elliotchance/orderedmap/v2 v2.6.0 h1:Zzo4k/u6hTRSt4NbYVphwOn5fBKlLpcbaV00INfJ1WI= -github.com/elliotchance/orderedmap/v2 v2.6.0/go.mod h1:85lZyVbpGaGvHvnKa7Qhx7zncAdBIBq6u56Hb1PRU5Q= +github.com/elliotchance/orderedmap/v3 v3.0.0 h1:Yay/tDjX+vzza+Drcoo8VEbuBnOYGpgenCXWcpQSFDg= github.com/elliotchance/orderedmap/v3 v3.0.0/go.mod h1:G+Hc2RwaZvJMcS4JpGCOyViCnGeKf0bTYCGTO4uhjSo= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= diff --git a/settings/server_v1.go b/settings/server_v1.go index db7d3390..98e04cdc 100644 --- a/settings/server_v1.go +++ b/settings/server_v1.go @@ -1,7 +1,7 @@ package settings import ( - "github.com/elliotchance/orderedmap/v2" + "github.com/elliotchance/orderedmap/v3" "github.com/spf13/cast" "github.com/uozi-tech/cosy/logger" "github.com/uozi-tech/cosy/settings" @@ -157,7 +157,7 @@ func migrate(confPath string) { migrated.Set("terminal", terminal) migrated.Set("webauthn", webauthn) - for name, ptr := range migrated.Iterator() { + for name, ptr := range migrated.AllFromFront() { err = Conf.Section(name).MapTo(ptr) if err != nil { logger.Error("migrate.MapTo %s err: %v", name, err) @@ -184,7 +184,7 @@ func migrate(confPath string) { Conf = ini.Empty() - for section, ptr := range migrated.Iterator() { + for section, ptr := range migrated.AllFromFront() { err = Conf.Section(section).ReflectFrom(ptr) if err != nil { logger.Fatalf("migrate.ReflectFrom %s err: %v", section, err) @@ -219,7 +219,7 @@ func migrateEnv() { deprecated.Set("SERVER_SKIP_INSTALLATION", "NODE_SKIP_INSTALLATION") deprecated.Set("SERVER_NAME", "NODE_NAME") - for d, n := range deprecated.Iterator() { + for d, n := range deprecated.AllFromFront() { oldValue := os.Getenv(EnvPrefix + d) if oldValue != "" { _ = os.Setenv(EnvPrefix+n, oldValue) diff --git a/settings/settings.go b/settings/settings.go index bdb81919..675ea2aa 100644 --- a/settings/settings.go +++ b/settings/settings.go @@ -2,7 +2,7 @@ package settings import ( "github.com/caarlos0/env/v11" - "github.com/elliotchance/orderedmap/v2" + "github.com/elliotchance/orderedmap/v3" "github.com/spf13/cast" "github.com/uozi-tech/cosy/settings" "log" @@ -57,7 +57,7 @@ func init() { sections.Set("terminal", TerminalSettings) sections.Set("webauthn", WebAuthnSettings) - for k, v := range sections.Iterator() { + for k, v := range sections.AllFromFront() { settings.Register(k, v) } settings.WithoutRedis()