Browse Source

Fixed typo and removed unused vars

Refs #408
Juan Basso 10 years ago
parent
commit
a27d03e799
No known key found for this signature in database GPG Key ID: 609DC24D13F096C
3 changed files with 10 additions and 1 deletions
  1. +1
    -1
      github/github.go
  2. +6
    -0
      github/timestamp_test.go
  3. +3
    -0
      tests/integration/users_test.go

+ 1
- 1
github/github.go View File

@ -414,7 +414,7 @@ func (c *Client) Do(req *http.Request, v interface{}) (*Response, error) {
// checkRateLimitBeforeDo does not make any network calls, but uses existing knowledge from
// current client state in order to quickly check if *RateLimitError can be immediately returned
// from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unneccessarily.
// from Client.Do, and if so, returns it so that Client.Do can skip making a network API call unnecessarily.
// Otherwise it returns nil, and Client.Do should proceed normally.
func (c *Client) checkRateLimitBeforeDo(req *http.Request, rateLimitCategory rateLimitCategory) error {
c.rateMu.Lock()


+ 6
- 0
github/timestamp_test.go View File

@ -93,6 +93,9 @@ func TestTimstamp_MarshalReflexivity(t *testing.T) {
}
var got Timestamp
err = json.Unmarshal(data, &got)
if err != nil {
t.Errorf("%s: Unmarshal err=%v", tc.desc, err)
}
if !got.Equal(tc.data) {
t.Errorf("%s: %+v != %+v", tc.desc, got, data)
}
@ -174,6 +177,9 @@ func TestWrappedTimstamp_MarshalReflexivity(t *testing.T) {
}
var got WrappedTimestamp
err = json.Unmarshal(bytes, &got)
if err != nil {
t.Errorf("%s: Unmarshal err=%v", tc.desc, err)
}
if !got.Time.Equal(tc.data.Time) {
t.Errorf("%s: %+v != %+v", tc.desc, got, tc.data)
}


+ 3
- 0
tests/integration/users_test.go View File

@ -87,6 +87,9 @@ func TestUsers_Update(t *testing.T) {
// set location back to the original value
u.Location = &location
_, _, err = client.Users.Edit(u)
if err != nil {
t.Fatalf("Users.Edit returned error: %v", err)
}
}
func TestUsers_Emails(t *testing.T) {


Loading…
Cancel
Save