Config: Correctly marshal `Address` to JSON (#4021)

pull/4028/head
yiguous 5 days ago committed by GitHub
parent 5a96ef632d
commit 55e045d098
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -42,6 +42,10 @@ type Address struct {
net.Address
}
func (v Address) MarshalJSON() ([]byte, error) {
return json.Marshal(v.Address.String())
}
func (v *Address) UnmarshalJSON(data []byte) error {
var rawStr string
if err := json.Unmarshal(data, &rawStr); err != nil {

Loading…
Cancel
Save