修复自定义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 HttpScheme string
func (hs HttpScheme) String() string {
return string(hs)
func (hs *HttpScheme) String() string {
return string(*hs)
}
func (hs HttpScheme) MarshalJSON() ([]byte, error) {
func (hs *HttpScheme) MarshalJSON() ([]byte, error) {
return []byte(hs.String()), nil
}