@@ -156,7 +156,7 @@ func (s *SignalR) parseMetadata(md map[string]string) (err error) {
156156 s .accessKey = connectionValue [i + 1 :]
157157 case "AuthType" :
158158 if connectionValue [i + 1 :] != "aad" {
159- return fmt . Errorf ("invalid value for AuthType in the connection string; only 'aad' is supported" )
159+ return errors . New ("invalid value for AuthType in the connection string; only 'aad' is supported" )
160160 }
161161 useAAD = true
162162 case "ClientId" , "ClientSecret" , "TenantId" :
@@ -171,14 +171,14 @@ func (s *SignalR) parseMetadata(md map[string]string) (err error) {
171171 }
172172 }
173173 } else if len (connectionValue ) != 0 {
174- return fmt . Errorf ("the connection string is invalid or malformed" )
174+ return errors . New ("the connection string is invalid or malformed" )
175175 }
176176 }
177177
178178 // Check here because if we use a connection string, we'd have an explicit "AuthType=aad" option
179179 // We would otherwise catch this issue later, but here we can be more explicit with the error
180180 if s .accessKey == "" && ! useAAD {
181- return fmt . Errorf ("missing AccessKey in the connection string" )
181+ return errors . New ("missing AccessKey in the connection string" )
182182 }
183183 }
184184
@@ -198,7 +198,7 @@ func (s *SignalR) parseMetadata(md map[string]string) (err error) {
198198
199199 // Check for required values
200200 if s .endpoint == "" {
201- return fmt . Errorf ("missing endpoint in the metadata or connection string" )
201+ return errors . New ("missing endpoint in the metadata or connection string" )
202202 }
203203
204204 return nil
@@ -333,7 +333,7 @@ func (s *SignalR) GetAadClientAccessToken(ctx context.Context, hub string, user
333333
334334 u := fmt .Sprintf ("%s/api/hubs/%s/:generateToken?api-version=%s" , s .endpoint , hub , apiVersion )
335335 if user != "" {
336- u += fmt . Sprintf ( "&userId=%s" , url .QueryEscape (user ) )
336+ u += "&userId=" + url .QueryEscape (user )
337337 }
338338
339339 body , err := s .sendRequestToSignalR (ctx , u , aadToken , nil )
0 commit comments