From 33980ebacf26643f8c829a74088efd3e31ea9aba Mon Sep 17 00:00:00 2001 From: John Beisley Date: Sun, 29 Sep 2013 16:09:10 +0100 Subject: [PATCH] Fix bug introduced by removing pointer indirection. --- cmd/discoverigd/discoverigd.go | 2 +- device.go | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/discoverigd/discoverigd.go b/cmd/discoverigd/discoverigd.go index 002c338..392aa80 100644 --- a/cmd/discoverigd/discoverigd.go +++ b/cmd/discoverigd/discoverigd.go @@ -24,7 +24,7 @@ func displayDevice(indent indentLevel, device *goupnp.Device) { if srv.ServiceType == goupnp.ServiceTypeWANPPPConnection { results, err := goupnp.PerformSoapAction(goupnp.ServiceTypeWANPPPConnection, "GetExternalIPAddress", &srv.ControlURL.URL, nil) if err != nil { - fmt.Println(err) + fmt.Println("Error calling GetExternalIPAddress:", err) } else { fmt.Println(results) } diff --git a/device.go b/device.go index 2045879..13a4951 100644 --- a/device.go +++ b/device.go @@ -59,14 +59,14 @@ func (device *Device) SetURLBase(urlBase *url.URL) { device.ManufacturerURL.SetURLBase(urlBase) device.ModelURL.SetURLBase(urlBase) device.PresentationURL.SetURLBase(urlBase) - for _, icon := range device.Icons { - icon.SetURLBase(urlBase) + for i := range device.Icons { + device.Icons[i].SetURLBase(urlBase) } - for _, srv := range device.Services { - srv.SetURLBase(urlBase) + for i := range device.Services { + device.Services[i].SetURLBase(urlBase) } - for _, child := range device.Devices { - child.SetURLBase(urlBase) + for i := range device.Devices { + device.Devices[i].SetURLBase(urlBase) } }