diff --git a/lib/osutil/mkdirall_windows.go b/lib/osutil/mkdirall_windows.go index 762632774..169f51963 100644 --- a/lib/osutil/mkdirall_windows.go +++ b/lib/osutil/mkdirall_windows.go @@ -25,7 +25,11 @@ func MkdirAll(path string, perm os.FileMode) error { if dir.IsDir() { return nil } - return &os.PathError{"mkdir", path, syscall.ENOTDIR} + return &os.PathError{ + Op: "mkdir", + Path: path, + Err: syscall.ENOTDIR, + } } // Slow path: make sure parent exists and then call Mkdir for path. diff --git a/lib/upnp/igd.go b/lib/upnp/igd.go index af8ab87e3..2acb95b7b 100644 --- a/lib/upnp/igd.go +++ b/lib/upnp/igd.go @@ -50,9 +50,9 @@ func (n *IGD) URL() *url.URL { // if action is fails for _any_ of the relevant services. For this reason, it // is generally better to configure port mapping for each individual service // instead. -func (n *IGD) AddPortMapping(protocol nat.Protocol, externalPort, internalPort int, description string, duration time.Duration) (int, error) { +func (n *IGD) AddPortMapping(protocol nat.Protocol, internalPort, externalPort int, description string, duration time.Duration) (int, error) { for _, service := range n.services { - err := service.AddPortMapping(n.localIPAddress, protocol, externalPort, internalPort, description, duration) + err := service.AddPortMapping(n.localIPAddress, protocol, internalPort, externalPort, description, duration) if err != nil { return externalPort, err } diff --git a/lib/upnp/igd_service.go b/lib/upnp/igd_service.go index a50f1aa5a..b796756fa 100644 --- a/lib/upnp/igd_service.go +++ b/lib/upnp/igd_service.go @@ -26,7 +26,7 @@ type IGDService struct { } // AddPortMapping adds a port mapping to the specified IGD service. -func (s *IGDService) AddPortMapping(localIPAddress net.IP, protocol nat.Protocol, externalPort, internalPort int, description string, duration time.Duration) error { +func (s *IGDService) AddPortMapping(localIPAddress net.IP, protocol nat.Protocol, internalPort, externalPort int, description string, duration time.Duration) error { tpl := ` %d