修复自定义Marshal序列化的BUG

This commit is contained in:
2025-01-22 15:55:39 +08:00
parent c00354fe46
commit 10759d9c5e
8 changed files with 48 additions and 29 deletions

View File

@ -9,11 +9,11 @@ package consts
type HttpHeader string
func (hh HttpHeader) String() string {
return string(hh)
func (hh *HttpHeader) String() string {
return string(*hh)
}
func (hh HttpHeader) MarshalJSON() ([]byte, error) {
func (hh *HttpHeader) MarshalJSON() ([]byte, error) {
return []byte(hh.String()), nil
}