mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-17 23:14:21 +01:00
refactor(rules): correct json format; remove MarshalJSON from []Rules
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user