修复自定义Marshal序列化的BUG
This commit is contained in:
@ -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
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user