Ordered json output & Disallow unknown fields

This commit is contained in:
世界
2022-07-03 11:28:15 +08:00
parent 85a695caa1
commit ef5cfd59d4
16 changed files with 243 additions and 26 deletions

View File

@@ -2,11 +2,11 @@ package main
import (
"context"
"encoding/json"
"os"
"os/signal"
"syscall"
"github.com/goccy/go-json"
"github.com/sagernet/sing-box"
"github.com/sagernet/sing-box/option"
"github.com/sirupsen/logrus"
@@ -51,7 +51,7 @@ func run(cmd *cobra.Command, args []string) {
var options option.Options
err = json.Unmarshal(configContent, &options)
if err != nil {
logrus.Fatal("parse config: ", err)
logrus.Fatal("decode config: ", err)
}
ctx, cancel := context.WithCancel(context.Background())