chore(deps): update orderedmap to v3

This commit is contained in:
Jacky 2024-12-14 17:36:48 +08:00
parent 779a60d456
commit d80db84adb
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
4 changed files with 8 additions and 9 deletions

2
go.mod
View file

@ -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

3
go.sum
View file

@ -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=

View file

@ -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)

View file

@ -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()