@@ -86,9 +86,9 @@ func Basic(client *http.Client, username, password string, urls ...string) Optio
8686}
8787
8888func  newSimpleClient (client  * http.Client , auth  string , urls  []string ) []* HTTPClient  {
89- 	clients  :=  make ([]* HTTPClient , len (urls ),  len ( urls ) )
90- 	for  index , baseUrl  :=  range  urls  {
91- 		clients [index ] =  & HTTPClient {BaseURL : baseUrl , Client : client , Authorization : auth }
89+ 	clients  :=  make ([]* HTTPClient , len (urls ))
90+ 	for  index , baseURL  :=  range  urls  {
91+ 		clients [index ] =  & HTTPClient {BaseURL : baseURL , Client : client , Authorization : auth }
9292	}
9393	return  clients 
9494}
@@ -147,26 +147,26 @@ func newCloudClientForService(name string, services map[string][]cfservices.Serv
147147	if  err  !=  nil  {
148148		return  nil , fmt .Errorf ("failed to create cloud Client: %w" , err )
149149	}
150- 	clients  :=  make ([]* HTTPClient , len (creds .Credentials ),  len ( creds . Credentials ) )
150+ 	clients  :=  make ([]* HTTPClient , len (creds .Credentials ))
151151	for  i , cred  :=  range  creds .Credentials  {
152152		clients [i ] =  & HTTPClient {BaseURL : cred .Uri , Client : newOAuth2Client (cred .ClientId , cred .ClientSecret , cred .AccessTokenUri )}
153153	}
154154	return  clients , nil 
155155}
156156
157157// OAuth2 creates a Client for a Config Server based on the provided OAuth2.0 information. 
158- func  OAuth2 (baseURL  string , clientId  string , secret  string , tokenURI  string ) Option  {
158+ func  OAuth2 (baseURL  string , clientID  string , secret  string , tokenURI  string ) Option  {
159159	return  func (clients  * []* HTTPClient ) error  {
160- 		* clients  =  append (* clients , & HTTPClient {BaseURL : baseURL , Client : newOAuth2Client (clientId , secret , tokenURI )})
160+ 		* clients  =  append (* clients , & HTTPClient {BaseURL : baseURL , Client : newOAuth2Client (clientID , secret , tokenURI )})
161161		return  nil 
162162	}
163163}
164164
165- func  newOAuth2Client (clientId  string , secret  string , tokenURI  string ) * http.Client  {
166- 	config  :=  newOAuth2Config (clientId , secret , tokenURI )
165+ func  newOAuth2Client (clientID  string , secret  string , tokenURI  string ) * http.Client  {
166+ 	config  :=  newOAuth2Config (clientID , secret , tokenURI )
167167	return  config .Client (context .Background ())
168168}
169169
170- func  newOAuth2Config (clientId  string , secret  string , tokenURI  string ) * clientcredentials.Config  {
171- 	return  & clientcredentials.Config {ClientID : clientId , ClientSecret : secret , TokenURL : tokenURI }
170+ func  newOAuth2Config (clientID  string , secret  string , tokenURI  string ) * clientcredentials.Config  {
171+ 	return  & clientcredentials.Config {ClientID : clientID , ClientSecret : secret , TokenURL : tokenURI }
172172}
0 commit comments