1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-22 18:17:52 -05:00
v2fly/common/net/network_json.go

19 lines
316 B
Go
Raw Normal View History

2016-01-15 08:34:33 -05:00
// +build json
package net
import (
2016-01-15 09:23:12 -05:00
"encoding/json"
2016-05-24 16:41:51 -04:00
"github.com/v2ray/v2ray-core/common/collect"
2016-01-15 08:34:33 -05:00
)
func (this *NetworkList) UnmarshalJSON(data []byte) error {
2016-05-24 16:41:51 -04:00
var strlist collect.StringList
2016-01-15 09:23:12 -05:00
if err := json.Unmarshal(data, &strlist); err != nil {
2016-01-15 08:34:33 -05:00
return err
}
*this = NewNetworkList(strlist)
return nil
}