Browse Source

chore(deps): update orderedmap to v3

Jacky 6 months ago
parent
commit
d80db84adb
4 changed files with 8 additions and 9 deletions
  1. 1 1
      go.mod
  2. 1 2
      go.sum
  3. 4 4
      settings/server_v1.go
  4. 2 2
      settings/settings.go

+ 1 - 1
go.mod

@@ -10,7 +10,6 @@ require (
 	github.com/creack/pty v1.1.24
 	github.com/creack/pty v1.1.24
 	github.com/dgraph-io/ristretto/v2 v2.0.1
 	github.com/dgraph-io/ristretto/v2 v2.0.1
 	github.com/dustin/go-humanize v1.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/elliotchance/orderedmap/v3 v3.0.0
 	github.com/fatih/color v1.18.0
 	github.com/fatih/color v1.18.0
 	github.com/gin-contrib/static v1.1.2
 	github.com/gin-contrib/static v1.1.2
@@ -107,6 +106,7 @@ require (
 	github.com/dimchansky/utfbom v1.1.1 // indirect
 	github.com/dimchansky/utfbom v1.1.1 // indirect
 	github.com/dnsimple/dnsimple-go v1.7.0 // indirect
 	github.com/dnsimple/dnsimple-go v1.7.0 // indirect
 	github.com/ebitengine/purego v0.8.1 // 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/exoscale/egoscale/v3 v3.1.7 // indirect
 	github.com/fatih/structs v1.1.0 // indirect
 	github.com/fatih/structs v1.1.0 // indirect
 	github.com/felixge/httpsnoop v1.0.4 // indirect
 	github.com/felixge/httpsnoop v1.0.4 // indirect

+ 1 - 2
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/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 h1:WRPmWGChucaZ09eEd3UkU8XfVajv6ZZ6eg3+x0cLWPM=
 github.com/elliotchance/orderedmap/v2 v2.5.0/go.mod h1:85lZyVbpGaGvHvnKa7Qhx7zncAdBIBq6u56Hb1PRU5Q=
 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/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.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=
 github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4=

+ 4 - 4
settings/server_v1.go

@@ -1,7 +1,7 @@
 package settings
 package settings
 
 
 import (
 import (
-	"github.com/elliotchance/orderedmap/v2"
+	"github.com/elliotchance/orderedmap/v3"
 	"github.com/spf13/cast"
 	"github.com/spf13/cast"
 	"github.com/uozi-tech/cosy/logger"
 	"github.com/uozi-tech/cosy/logger"
 	"github.com/uozi-tech/cosy/settings"
 	"github.com/uozi-tech/cosy/settings"
@@ -157,7 +157,7 @@ func migrate(confPath string) {
 	migrated.Set("terminal", terminal)
 	migrated.Set("terminal", terminal)
 	migrated.Set("webauthn", webauthn)
 	migrated.Set("webauthn", webauthn)
 
 
-	for name, ptr := range migrated.Iterator() {
+	for name, ptr := range migrated.AllFromFront() {
 		err = Conf.Section(name).MapTo(ptr)
 		err = Conf.Section(name).MapTo(ptr)
 		if err != nil {
 		if err != nil {
 			logger.Error("migrate.MapTo %s err: %v", name, err)
 			logger.Error("migrate.MapTo %s err: %v", name, err)
@@ -184,7 +184,7 @@ func migrate(confPath string) {
 
 
 	Conf = ini.Empty()
 	Conf = ini.Empty()
 
 
-	for section, ptr := range migrated.Iterator() {
+	for section, ptr := range migrated.AllFromFront() {
 		err = Conf.Section(section).ReflectFrom(ptr)
 		err = Conf.Section(section).ReflectFrom(ptr)
 		if err != nil {
 		if err != nil {
 			logger.Fatalf("migrate.ReflectFrom %s err: %v", section, err)
 			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_SKIP_INSTALLATION", "NODE_SKIP_INSTALLATION")
 	deprecated.Set("SERVER_NAME", "NODE_NAME")
 	deprecated.Set("SERVER_NAME", "NODE_NAME")
 
 
-	for d, n := range deprecated.Iterator() {
+	for d, n := range deprecated.AllFromFront() {
 		oldValue := os.Getenv(EnvPrefix + d)
 		oldValue := os.Getenv(EnvPrefix + d)
 		if oldValue != "" {
 		if oldValue != "" {
 			_ = os.Setenv(EnvPrefix+n, oldValue)
 			_ = os.Setenv(EnvPrefix+n, oldValue)

+ 2 - 2
settings/settings.go

@@ -2,7 +2,7 @@ package settings
 
 
 import (
 import (
 	"github.com/caarlos0/env/v11"
 	"github.com/caarlos0/env/v11"
-	"github.com/elliotchance/orderedmap/v2"
+	"github.com/elliotchance/orderedmap/v3"
 	"github.com/spf13/cast"
 	"github.com/spf13/cast"
 	"github.com/uozi-tech/cosy/settings"
 	"github.com/uozi-tech/cosy/settings"
 	"log"
 	"log"
@@ -57,7 +57,7 @@ func init() {
 	sections.Set("terminal", TerminalSettings)
 	sections.Set("terminal", TerminalSettings)
 	sections.Set("webauthn", WebAuthnSettings)
 	sections.Set("webauthn", WebAuthnSettings)
 
 
-	for k, v := range sections.Iterator() {
+	for k, v := range sections.AllFromFront() {
 		settings.Register(k, v)
 		settings.Register(k, v)
 	}
 	}
 	settings.WithoutRedis()
 	settings.WithoutRedis()