Skip to content

Commit

Permalink
useless
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Aug 18, 2022
1 parent 728f807 commit e2c16cd
Showing 1 changed file with 5 additions and 25 deletions.
30 changes: 5 additions & 25 deletions ogame.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,7 @@ func execLoginLink(b *OGame, loginLink string) ([]byte, error) {
if err != nil {
return nil, err
}
defer func() {
if err := resp.Body.Close(); err != nil {
b.error(err)
}
}()
defer resp.Body.Close()
return readBody(resp)
}

Expand Down Expand Up @@ -973,11 +969,7 @@ func (b *OGame) connectChatV8(host, port string) {
b.error("failed to get socket.io token:", err)
return
}
defer func() {
if err := resp.Body.Close(); err != nil {
b.error(err)
}
}()
defer resp.Body.Close()
b.chatRetry.Reset()
by, _ := ioutil.ReadAll(resp.Body)
m := regexp.MustCompile(`"sid":"([^"]+)"`).FindSubmatch(by)
Expand Down Expand Up @@ -1154,11 +1146,7 @@ func (b *OGame) connectChatV7(host, port string) {
b.error("failed to get socket.io token:", err)
return
}
defer func() {
if err := resp.Body.Close(); err != nil {
b.error(err)
}
}()
defer resp.Body.Close()
b.chatRetry.Reset()
by, _ := ioutil.ReadAll(resp.Body)
token := strings.Split(string(by), ":")[0]
Expand Down Expand Up @@ -2993,11 +2981,7 @@ func (b *OGame) setResourceSettings(planetID PlanetID, settings ResourceSettings
if err != nil {
return err
}
defer func() {
if err := resp.Body.Close(); err != nil {
b.error(err)
}
}()
defer resp.Body.Close()
return nil
}

Expand Down Expand Up @@ -4121,11 +4105,7 @@ func (b *OGame) getPublicIP() (string, error) {
if err != nil {
return "", err
}
defer func() {
if err := resp.Body.Close(); err != nil {
b.error(err)
}
}()
defer resp.Body.Close()
by, err := readBody(resp)
if err != nil {
return "", err
Expand Down

0 comments on commit e2c16cd

Please sign in to comment.