Skip to content

Commit

Permalink
remove depend of gopkg.in/yaml.v2
Browse files Browse the repository at this point in the history
  • Loading branch information
wwqgtxx committed Aug 31, 2024
1 parent e548b93 commit c9fa690
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 9 deletions.
3 changes: 1 addition & 2 deletions core/src/main/golang/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ require (
github.com/miekg/dns v1.1.62
github.com/oschwald/maxminddb-golang v1.12.0
golang.org/x/sync v0.8.0
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

replace github.com/metacubex/mihomo => ../../foss/golang/clash
Expand Down Expand Up @@ -111,6 +111,5 @@ require (
golang.org/x/time v0.5.0 // indirect
golang.org/x/tools v0.24.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
lukechampine.com/blake3 v1.3.0 // indirect
)
2 changes: 0 additions & 2 deletions core/src/main/golang/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6h
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
Expand Down
6 changes: 3 additions & 3 deletions core/src/main/golang/native/config/load.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package config

import (
"io/ioutil"
"os"
P "path"
"runtime"
"strings"

"gopkg.in/yaml.v2"
"gopkg.in/yaml.v3"

"cfa/native/app"

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

configData, err := ioutil.ReadFile(configPath)
configData, err := os.ReadFile(configPath)
if err != nil {
return nil, err
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/golang/native/config/override.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package config

import (
"io/ioutil"
"io"
"os"

"github.com/metacubex/mihomo/constant"
Expand Down Expand Up @@ -31,7 +31,7 @@ func ReadOverride(slot OverrideSlot) string {
return defaultPersistOverride
}

buf, err := ioutil.ReadAll(file)
buf, err := io.ReadAll(file)
if err != nil {
return defaultPersistOverride
}
Expand Down

0 comments on commit c9fa690

Please sign in to comment.