-func encodingExample() {
- // create union with IPv4 address
- var unionIP4 ip.AddressUnion
- unionIP4.SetIP4(ip.IP4Address{192, 168, 1, 10})
-
- // use it in the Address type
- addr := &ip.Address{
- Af: ip_types.ADDRESS_IP4,
- Un: ip_types.AddressUnionIP4(ip.IP4Address{192, 168, 1, 10}),
- }
- log.Printf("encoding union IPv4: %v", addr.Un.GetIP4())