From ae11242ea64720babf4f34772cb3a2eae260efe0 Mon Sep 17 00:00:00 2001 From: Patrick Jones Date: Mon, 19 Oct 2020 01:40:53 -0700 Subject: [PATCH] Requested changes. --- .../oauth/{clientAuthentication.go => clientauth.go} | 4 ++-- .../{clientAuthentication_test.go => clientauth_test.go} | 0 google/internal/externalaccount/oauth/err.go | 2 +- google/internal/externalaccount/oauth/err_test.go | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) rename google/internal/externalaccount/oauth/{clientAuthentication.go => clientauth.go} (90%) rename google/internal/externalaccount/oauth/{clientAuthentication_test.go => clientauth_test.go} (100%) diff --git a/google/internal/externalaccount/oauth/clientAuthentication.go b/google/internal/externalaccount/oauth/clientauth.go similarity index 90% rename from google/internal/externalaccount/oauth/clientAuthentication.go rename to google/internal/externalaccount/oauth/clientauth.go index fc09998..94755c8 100644 --- a/google/internal/externalaccount/oauth/clientAuthentication.go +++ b/google/internal/externalaccount/oauth/clientauth.go @@ -7,7 +7,7 @@ import ( "net/url" ) -// ClientAuthentication represents an OAuth client ID and secret and the mechanism for passing these credentials as stated in rfc6749#2.3.1 +// ClientAuthentication represents an OAuth client ID and secret and the mechanism for passing these credentials as stated in rfc6749#2.3.1. type ClientAuthentication struct { //Can be either basic or request-body AuthStyle oauth2.AuthStyle @@ -15,7 +15,7 @@ type ClientAuthentication struct { ClientSecret string } -func (c *ClientAuthentication) InjectAuthentication(values *url.Values, headers *http.Header) { +func (c *ClientAuthentication) InjectAuthentication(values url.Values, headers http.Header) { if c.ClientID == "" || c.ClientSecret == "" || values == nil || headers == nil { return } diff --git a/google/internal/externalaccount/oauth/clientAuthentication_test.go b/google/internal/externalaccount/oauth/clientauth_test.go similarity index 100% rename from google/internal/externalaccount/oauth/clientAuthentication_test.go rename to google/internal/externalaccount/oauth/clientauth_test.go diff --git a/google/internal/externalaccount/oauth/err.go b/google/internal/externalaccount/oauth/err.go index 8e183d3..5366cd0 100644 --- a/google/internal/externalaccount/oauth/err.go +++ b/google/internal/externalaccount/oauth/err.go @@ -2,7 +2,7 @@ package externalaccount import "fmt" -//Struct for handling OAuth related error responses as stated in rfc6749#5.2 +//Error for handling OAuth related error responses as stated in rfc6749#5.2. type Error struct { Code string URI string diff --git a/google/internal/externalaccount/oauth/err_test.go b/google/internal/externalaccount/oauth/err_test.go index 74a9462..deb6c5b 100644 --- a/google/internal/externalaccount/oauth/err_test.go +++ b/google/internal/externalaccount/oauth/err_test.go @@ -8,8 +8,8 @@ func TestError_Generator(t *testing.T) { "http:thisIsAPlaceholder", "The Answer!", } - output := "got error code " + "42" + " from " + "http:thisIsAPlaceholder" + ": " + "The Answer!" - if got, want := e, output; e.Error() != output { + want := "got error code " + "42" + " from " + "http:thisIsAPlaceholder" + ": " + "The Answer!" + if got := e.Error(); got != want { t.Errorf("Got error message %q; want %q", got, want) } }