func TestStringNetworkList(t *testing.T) { assert := assert.On(t) var list NetworkList err := json.Unmarshal([]byte("\"TCP, ip\""), &list) assert.Error(err).IsNil() nlist := list.Build() assert.Bool(nlist.HasNetwork(v2net.ParseNetwork("tcp"))).IsTrue() assert.Bool(nlist.HasNetwork(v2net.ParseNetwork("udp"))).IsFalse() }
func (this Network) Build() v2net.Network { return v2net.ParseNetwork(string(this)) }
func (v Network) Build() v2net.Network { return v2net.ParseNetwork(string(v)) }