From 9f27eeff53ee501b8641595baa7cbc2f0014a68c Mon Sep 17 00:00:00 2001 From: Ondrej Fabry Date: Wed, 18 Mar 2020 10:18:03 +0100 Subject: Fix import path in examples/binapi Change-Id: I6af1ae2778b73f37be09c64a2948417e576f02ab Signed-off-by: Ondrej Fabry --- examples/union-example/union_example.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'examples/union-example/union_example.go') diff --git a/examples/union-example/union_example.go b/examples/union-example/union_example.go index 22fb362..92c3ec2 100644 --- a/examples/union-example/union_example.go +++ b/examples/union-example/union_example.go @@ -22,6 +22,8 @@ import ( "net" "git.fd.io/govpp.git/examples/binapi/ip" + "git.fd.io/govpp.git/examples/binapi/ip_types" + "github.com/lunixbochs/struc" ) @@ -37,8 +39,8 @@ func encodingExample() { // use it in the Address type addr := &ip.Address{ - Af: ip.ADDRESS_IP4, - Un: ip.AddressUnionIP4(ip.IP4Address{192, 168, 1, 10}), + Af: ip_types.ADDRESS_IP4, + Un: ip_types.AddressUnionIP4(ip.IP4Address{192, 168, 1, 10}), } log.Printf("encoding union IPv4: %v", addr.Un.GetIP4()) @@ -89,12 +91,12 @@ func ipToAddress(ipstr string) (addr ip.Address, err error) { return ip.Address{}, fmt.Errorf("invalid IP: %q", ipstr) } if ip4 := netIP.To4(); ip4 == nil { - addr.Af = ip.ADDRESS_IP6 + addr.Af = ip_types.ADDRESS_IP6 var ip6addr ip.IP6Address copy(ip6addr[:], netIP.To16()) addr.Un.SetIP6(ip6addr) } else { - addr.Af = ip.ADDRESS_IP4 + addr.Af = ip_types.ADDRESS_IP4 var ip4addr ip.IP4Address copy(ip4addr[:], ip4) addr.Un.SetIP4(ip4addr) -- cgit 1.2.3-korg