Run go fmt.

This commit is contained in:
Patrick Jones 2020-10-06 01:18:45 -07:00
parent 7792988ab8
commit 802bddef7c
4 changed files with 23 additions and 24 deletions

View File

@ -8,10 +8,9 @@ import (
"testing" "testing"
) )
var clientID = "rbrgnognrhongo3bi4gb9ghg9g" var clientID = "rbrgnognrhongo3bi4gb9ghg9g"
var clientSecret = "notsosecret" var clientSecret = "notsosecret"
var valuesH = url.Values { var valuesH = url.Values{
"audience": []string{"32555940559.apps.googleusercontent.com"}, "audience": []string{"32555940559.apps.googleusercontent.com"},
"grant_type": []string{"urn:ietf:params:oauth:grant-type:token-exchange"}, "grant_type": []string{"urn:ietf:params:oauth:grant-type:token-exchange"},
"requested_token_type": []string{"urn:ietf:params:oauth:token-type:access_token"}, "requested_token_type": []string{"urn:ietf:params:oauth:token-type:access_token"},
@ -20,11 +19,11 @@ var valuesH = url.Values {
"scope": []string{"https://www.googleapis.com/auth/devstorage.full_control"}, "scope": []string{"https://www.googleapis.com/auth/devstorage.full_control"},
} }
var headerH = http.Header { var headerH = http.Header{
"Content-Type": []string{"application/x-www-form-urlencoded"}, "Content-Type": []string{"application/x-www-form-urlencoded"},
} }
var valuesP = url.Values { var valuesP = url.Values{
"audience": []string{"32555940559.apps.googleusercontent.com"}, "audience": []string{"32555940559.apps.googleusercontent.com"},
"grant_type": []string{"urn:ietf:params:oauth:grant-type:token-exchange"}, "grant_type": []string{"urn:ietf:params:oauth:grant-type:token-exchange"},
"requested_token_type": []string{"urn:ietf:params:oauth:token-type:access_token"}, "requested_token_type": []string{"urn:ietf:params:oauth:token-type:access_token"},
@ -33,7 +32,7 @@ var valuesP = url.Values {
"scope": []string{"https://www.googleapis.com/auth/devstorage.full_control"}, "scope": []string{"https://www.googleapis.com/auth/devstorage.full_control"},
} }
var headerP = http.Header { var headerP = http.Header{
"Content-Type": []string{"application/x-www-form-urlencoded"}, "Content-Type": []string{"application/x-www-form-urlencoded"},
} }
@ -63,7 +62,7 @@ func TestClientAuthentication_InjectHeaderAuthentication(t *testing.T) {
if got, want := valuesH["scope"], []string{"https://www.googleapis.com/auth/devstorage.full_control"}; !reflect.DeepEqual(got, want) { if got, want := valuesH["scope"], []string{"https://www.googleapis.com/auth/devstorage.full_control"}; !reflect.DeepEqual(got, want) {
t.Errorf("scope = %q, want %q", got, want) t.Errorf("scope = %q, want %q", got, want)
} }
if got, want := headerH["Authorization"],[]string{"Basic cmJyZ25vZ25yaG9uZ28zYmk0Z2I5Z2hnOWc6bm90c29zZWNyZXQ="}; !reflect.DeepEqual(got, want) { if got, want := headerH["Authorization"], []string{"Basic cmJyZ25vZ25yaG9uZ28zYmk0Z2I5Z2hnOWc6bm90c29zZWNyZXQ="}; !reflect.DeepEqual(got, want) {
t.Errorf("Authorization in header = %q, want %q", got, want) t.Errorf("Authorization in header = %q, want %q", got, want)
} }
} }