diff --git a/cmd/sing-box/cmd_format.go b/cmd/sing-box/cmd_format.go index 5a811a90..47b8a00a 100644 --- a/cmd/sing-box/cmd_format.go +++ b/cmd/sing-box/cmd_format.go @@ -38,7 +38,7 @@ func format() error { return E.Cause(err, "read config") } var options option.Options - err = json.Unmarshal(configContent, &options) + err = options.UnmarshalJSON(configContent) if err != nil { return E.Cause(err, "decode config") } diff --git a/cmd/sing-box/cmd_run.go b/cmd/sing-box/cmd_run.go index 6298387d..77572ff6 100644 --- a/cmd/sing-box/cmd_run.go +++ b/cmd/sing-box/cmd_run.go @@ -9,7 +9,6 @@ import ( "syscall" "github.com/sagernet/sing-box" - "github.com/sagernet/sing-box/common/json" "github.com/sagernet/sing-box/log" "github.com/sagernet/sing-box/option" E "github.com/sagernet/sing/common/exceptions" @@ -46,7 +45,7 @@ func readConfig() (option.Options, error) { return option.Options{}, E.Cause(err, "read config") } var options option.Options - err = json.Unmarshal(configContent, &options) + err = options.UnmarshalJSON(configContent) if err != nil { return option.Options{}, E.Cause(err, "decode config") }