File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import (
1313 "github.com/metacubex/mihomo/adapter"
1414 "github.com/metacubex/mihomo/common/convert"
1515 "github.com/metacubex/mihomo/common/utils"
16+ "github.com/metacubex/mihomo/common/yaml"
1617 "github.com/metacubex/mihomo/component/profile/cachefile"
1718 "github.com/metacubex/mihomo/component/resource"
1819 C "github.com/metacubex/mihomo/constant"
@@ -21,7 +22,6 @@ import (
2122
2223 "github.com/dlclark/regexp2"
2324 "github.com/metacubex/http"
24- "gopkg.in/yaml.v3"
2525)
2626
2727const (
Original file line number Diff line number Diff line change 1+ // Package yaml provides a common entrance for YAML marshaling and unmarshalling.
2+ package yaml
3+
4+ import (
5+ "gopkg.in/yaml.v3"
6+ )
7+
8+ func Unmarshal (in []byte , out any ) (err error ) {
9+ return yaml .Unmarshal (in , out )
10+ }
11+
12+ func Marshal (in any ) (out []byte , err error ) {
13+ return yaml .Marshal (in )
14+ }
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import (
1616 "github.com/metacubex/mihomo/adapter/outboundgroup"
1717 "github.com/metacubex/mihomo/adapter/provider"
1818 "github.com/metacubex/mihomo/common/utils"
19+ "github.com/metacubex/mihomo/common/yaml"
1920 "github.com/metacubex/mihomo/component/auth"
2021 "github.com/metacubex/mihomo/component/cidr"
2122 "github.com/metacubex/mihomo/component/fakeip"
@@ -39,7 +40,6 @@ import (
3940
4041 orderedmap "github.com/wk8/go-ordered-map/v2"
4142 "golang.org/x/exp/slices"
42- "gopkg.in/yaml.v3"
4343)
4444
4545// General config
Original file line number Diff line number Diff line change @@ -10,12 +10,11 @@ import (
1010 "time"
1111
1212 "github.com/metacubex/mihomo/common/pool"
13+ "github.com/metacubex/mihomo/common/yaml"
1314 "github.com/metacubex/mihomo/component/resource"
1415 C "github.com/metacubex/mihomo/constant"
1516 P "github.com/metacubex/mihomo/constant/provider"
1617 "github.com/metacubex/mihomo/rules/common"
17-
18- "gopkg.in/yaml.v3"
1918)
2019
2120var tunnel P.Tunnel
You can’t perform that action at this time.
0 commit comments