Pull request: home: imp err handling, marshalling
Merge in DNS/adguard-home from imp-code to master Squashed commit of the following: commit 9433fb9b0154a1cfaf804edbfa8531efbbcbf68a Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Fri May 14 19:24:32 2021 +0300 home: imp err handling, marshalling
This commit is contained in:
@@ -84,17 +84,17 @@ type NetInterface struct {
|
||||
Subnets []*net.IPNet `json:"-"`
|
||||
}
|
||||
|
||||
// MarshalJSON implements the json.Marshaler interface for *NetInterface.
|
||||
func (iface *NetInterface) MarshalJSON() ([]byte, error) {
|
||||
// MarshalJSON implements the json.Marshaler interface for NetInterface.
|
||||
func (iface NetInterface) MarshalJSON() ([]byte, error) {
|
||||
type netInterface NetInterface
|
||||
return json.Marshal(&struct {
|
||||
HardwareAddr string `json:"hardware_address"`
|
||||
Flags string `json:"flags"`
|
||||
*netInterface
|
||||
netInterface
|
||||
}{
|
||||
HardwareAddr: iface.HardwareAddr.String(),
|
||||
Flags: iface.Flags.String(),
|
||||
netInterface: (*netInterface)(iface),
|
||||
netInterface: netInterface(iface),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user