mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-22 19:08:58 +00:00
lib: simplify code
GitHub-Pull-Request: https://github.com/syncthing/syncthing/pull/3119
This commit is contained in:
parent
8e060e23e3
commit
22280db5db
@ -180,11 +180,7 @@ func upgradeToURL(archiveName, binary string, url string) error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = os.Rename(fname, binary)
|
return os.Rename(fname, binary)
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func readRelease(archiveName, dir, url string) (string, error) {
|
func readRelease(archiveName, dir, url string) (string, error) {
|
||||||
|
@ -87,12 +87,7 @@ func (s *IGDService) DeletePortMapping(protocol nat.Protocol, externalPort int)
|
|||||||
body := fmt.Sprintf(tpl, s.URN, externalPort, protocol)
|
body := fmt.Sprintf(tpl, s.URN, externalPort, protocol)
|
||||||
|
|
||||||
_, err := soapRequest(s.URL, s.URN, "DeletePortMapping", body)
|
_, err := soapRequest(s.URL, s.URN, "DeletePortMapping", body)
|
||||||
|
return err
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetExternalIPAddress queries the IGD service for its external IP address.
|
// GetExternalIPAddress queries the IGD service for its external IP address.
|
||||||
|
Loading…
Reference in New Issue
Block a user