style: gofumpt all the things (#9829)
Literally `gofumpt -w .` from the top level dir. Guaranteed to be minor style changes only and nothing else. @imsodin per request?
This commit is contained in:
+1
-3
@@ -10,6 +10,4 @@ import (
|
||||
"github.com/syncthing/syncthing/lib/logger"
|
||||
)
|
||||
|
||||
var (
|
||||
l = logger.DefaultLogger.NewFacility("upnp", "UPnP discovery and port mapping")
|
||||
)
|
||||
var l = logger.DefaultLogger.NewFacility("upnp", "UPnP discovery and port mapping")
|
||||
|
||||
+1
-3
@@ -210,7 +210,6 @@ USER-AGENT: syncthing/%s
|
||||
proto = "udp6"
|
||||
}
|
||||
socket, err := net.ListenMulticastUDP(proto, intf, &net.UDPAddr{IP: ssdp.IP})
|
||||
|
||||
if err != nil {
|
||||
if runtime.GOOS == "windows" && ip6 {
|
||||
// Requires https://github.com/golang/go/issues/63529 to be fixed.
|
||||
@@ -257,7 +256,7 @@ loop:
|
||||
if e, ok := err.(net.Error); ok && e.Timeout() {
|
||||
continue // continue reading
|
||||
}
|
||||
l.Infoln("UPnP read:", err) //legitimate error, not a timeout.
|
||||
l.Infoln("UPnP read:", err) // legitimate error, not a timeout.
|
||||
break
|
||||
}
|
||||
|
||||
@@ -411,7 +410,6 @@ func localIPv4Fallback(ctx context.Context, url *url.URL) (net.IP, error) {
|
||||
defer cancel()
|
||||
|
||||
conn, err := dialer.DialContext(timeoutCtx, "udp4", url.Host)
|
||||
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -13,8 +13,7 @@ import (
|
||||
)
|
||||
|
||||
func TestExternalIPParsing(t *testing.T) {
|
||||
soapResponse :=
|
||||
[]byte(`<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
||||
soapResponse := []byte(`<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
||||
<s:Body>
|
||||
<u:GetExternalIPAddressResponse xmlns:u="urn:schemas-upnp-org:service:WANIPConnection:1">
|
||||
<NewExternalIPAddress>1.2.3.4</NewExternalIPAddress>
|
||||
@@ -34,8 +33,7 @@ func TestExternalIPParsing(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSoapFaultParsing(t *testing.T) {
|
||||
soapResponse :=
|
||||
[]byte(`<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
||||
soapResponse := []byte(`<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
||||
<s:Body>
|
||||
<s:Fault>
|
||||
<faultcode>s:Client</faultcode>
|
||||
|
||||
Reference in New Issue
Block a user