Skip to content

Commit

Permalink
implement Get for the ogame client
Browse files Browse the repository at this point in the history
  • Loading branch information
alaingilbert committed Aug 7, 2022
1 parent 8837db2 commit e5f9f30
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@ func (c *OGameClient) incrRPS() {
}
}

func (c *OGameClient) Get(url string) (*http.Response, error) {
req, err := http.NewRequest(http.MethodGet, url, nil)
if err != nil {
return nil, err
}
return c.Do(req)
}

// Do executes a request
func (c *OGameClient) Do(req *http.Request) (*http.Response, error) {
c.incrRPS()
Expand Down

0 comments on commit e5f9f30

Please sign in to comment.