Skip to content

Commit c9fa690

Browse files
committed
remove depend of gopkg.in/yaml.v2
1 parent e548b93 commit c9fa690

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

core/src/main/golang/go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ require (
99
github.com/miekg/dns v1.1.62
1010
github.com/oschwald/maxminddb-golang v1.12.0
1111
golang.org/x/sync v0.8.0
12-
gopkg.in/yaml.v2 v2.4.0
12+
gopkg.in/yaml.v3 v3.0.1
1313
)
1414

1515
replace github.com/metacubex/mihomo => ../../foss/golang/clash
@@ -111,6 +111,5 @@ require (
111111
golang.org/x/time v0.5.0 // indirect
112112
golang.org/x/tools v0.24.0 // indirect
113113
google.golang.org/protobuf v1.34.2 // indirect
114-
gopkg.in/yaml.v3 v3.0.1 // indirect
115114
lukechampine.com/blake3 v1.3.0 // indirect
116115
)

core/src/main/golang/go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6h
267267
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
268268
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
269269
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
270-
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
271-
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
272270
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
273271
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
274272
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

core/src/main/golang/native/config/load.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
package config
22

33
import (
4-
"io/ioutil"
4+
"os"
55
P "path"
66
"runtime"
77
"strings"
88

9-
"gopkg.in/yaml.v2"
9+
"gopkg.in/yaml.v3"
1010

1111
"cfa/native/app"
1212

@@ -33,7 +33,7 @@ func logDns(cfg *config.RawConfig) {
3333
func UnmarshalAndPatch(profilePath string) (*config.RawConfig, error) {
3434
configPath := P.Join(profilePath, "config.yaml")
3535

36-
configData, err := ioutil.ReadFile(configPath)
36+
configData, err := os.ReadFile(configPath)
3737
if err != nil {
3838
return nil, err
3939
}

core/src/main/golang/native/config/override.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package config
22

33
import (
4-
"io/ioutil"
4+
"io"
55
"os"
66

77
"github.com/metacubex/mihomo/constant"
@@ -31,7 +31,7 @@ func ReadOverride(slot OverrideSlot) string {
3131
return defaultPersistOverride
3232
}
3333

34-
buf, err := ioutil.ReadAll(file)
34+
buf, err := io.ReadAll(file)
3535
if err != nil {
3636
return defaultPersistOverride
3737
}

0 commit comments

Comments
 (0)