From 136ef5cdab23a105b08ae7ee273afdc557aa64b8 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Sat, 9 Jul 2016 00:04:14 -0700 Subject: [PATCH] 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 --- github/github.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/github/github.go b/github/github.go index 49bb74b..deb3c16 100644 --- a/github/github.go +++ b/github/github.go @@ -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