From e6866ee980ac78805b6d7336bb760378979032d9 Mon Sep 17 00:00:00 2001 From: Jakob Borg Date: Tue, 5 May 2015 13:53:11 +0200 Subject: [PATCH] strings.TrimLeft is not actually TrimPrefix --- internal/upnp/upnp.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/upnp/upnp.go b/internal/upnp/upnp.go index 10d123f0..b62a8752 100644 --- a/internal/upnp/upnp.go +++ b/internal/upnp/upnp.go @@ -255,7 +255,7 @@ func parseResponse(deviceType string, resp []byte) (IGD, error) { return IGD{}, errors.New("invalid IGD response: USN not specified") } - deviceUUID := strings.TrimLeft(strings.Split(deviceUSN, "::")[0], "uuid:") + deviceUUID := strings.TrimPrefix(strings.Split(deviceUSN, "::")[0], "uuid:") matched, err := regexp.MatchString("[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}", deviceUUID) if !matched { l.Infoln("Invalid IGD response: invalid device UUID", deviceUUID, "(continuing anyway)")