refactor(rules): correct json format; remove MarshalJSON from []Rules

This commit is contained in:
yusing
2025-11-14 20:53:35 +08:00
parent 06ddb178f8
commit 84b17baf46

View File

@@ -5,7 +5,6 @@ import (
"fmt"
"net/http"
"github.com/bytedance/sonic"
"github.com/quic-go/quic-go/http3"
"github.com/rs/zerolog/log"
"golang.org/x/net/http2"
@@ -243,14 +242,6 @@ func isTerminatingHandler(handler CommandHandler) bool {
}
}
func (rules Rules) MarshalJSON() ([]byte, error) {
names := make([]string, len(rules))
for i, rule := range rules {
names[i] = rule.Name
}
return sonic.Marshal(names)
}
func (rule *Rule) String() string {
return rule.Name
}