Browse Source

Put sync.Mutex on top of variables it protects.

This change makes the code more consistent with the rateMu below.

This is a followup to https://github.com/google/go-github/pull/390#discussion_r68863652.

Closes #396.

Change-Id: I0fc8b280911f9171fb4d8e3fa60cf6d53b64a65b
Dmitri Shuralyov 10 years ago
committed by Glenn Lewis
parent
commit
136ef5cdab
1 changed files with 2 additions and 4 deletions
  1. +2
    -4
      github/github.go

+ 2
- 4
github/github.go View File

@ -88,10 +88,8 @@ const (
// A Client manages communication with the GitHub API.
type Client struct {
// HTTP client used to communicate with the API.
client *http.Client
// clientMu protects the client during calls that modify the CheckRedirect func.
clientMu sync.Mutex
clientMu sync.Mutex // clientMu protects the client during calls that modify the CheckRedirect func.
client *http.Client // HTTP client used to communicate with the API.
// Base URL for API requests. Defaults to the public GitHub API, but can be
// set to a domain endpoint to use with GitHub Enterprise. BaseURL should


Loading…
Cancel
Save