@@ -123,7 +123,7 @@ func GetClient(timeout uint) *http.Client {
123123
124124 client .CheckRedirect = func (req * http.Request , via []* http.Request ) error {
125125 if len (via ) > 1 {
126- return fmt . Errorf ("too many redirects" )
126+ return errors . New ("too many redirects" )
127127 }
128128 if len (via ) != 0 && req .Response .StatusCode == http .StatusMovedPermanently {
129129 for attr , val := range via [0 ].Header {
@@ -349,7 +349,7 @@ func addTenantAuthURI(baseAuthURI string) (string, error) {
349349 tenant := viper .GetString (commonParams .TenantKey )
350350
351351 if tenant == "" {
352- return "" , errors .Errorf (MissingTenant )
352+ return "" , errors .New (MissingTenant )
353353 }
354354
355355 authPath = strings .Replace (authPath , "organization" , strings .ToLower (tenant ), 1 )
@@ -454,9 +454,9 @@ func configureClientCredentialsAndGetNewToken() (string, error) {
454454 var accessToken string
455455
456456 if accessKeyID == "" && astAPIKey == "" {
457- return "" , errors .Errorf (fmt . Sprintf ( FailedToAuth , "access key ID" ) )
457+ return "" , errors .Errorf (FailedToAuth , "access key ID" )
458458 } else if accessKeySecret == "" && astAPIKey == "" {
459- return "" , errors .Errorf (fmt . Sprintf ( FailedToAuth , "access key secret" ) )
459+ return "" , errors .Errorf (FailedToAuth , "access key secret" )
460460 }
461461
462462 authURI , err := GetAuthURI ()
@@ -642,12 +642,12 @@ func request(client *http.Client, req *http.Request, responseBody bool) (*http.R
642642func handleRedirect (resp * http.Response , req * http.Request , body []byte ) (* http.Request , error ) {
643643 redirectURL := resp .Header .Get ("Location" )
644644 if redirectURL == "" {
645- return nil , fmt . Errorf (applicationErrors .RedirectURLNotFound )
645+ return nil , errors . New (applicationErrors .RedirectURLNotFound )
646646 }
647647
648648 method := GetHTTPMethod (req )
649649 if method == "" {
650- return nil , fmt . Errorf (applicationErrors .HTTPMethodNotFound )
650+ return nil , errors . New (applicationErrors .HTTPMethodNotFound )
651651 }
652652
653653 newReq , err := recreateRequest (req , method , redirectURL , body )
@@ -764,7 +764,7 @@ func GetURL(path, accessToken string) (string, error) {
764764 }
765765
766766 if cleanURL == "" {
767- return "" , errors .Errorf (MissingURI )
767+ return "" , errors .New (MissingURI )
768768 }
769769
770770 cleanURL = strings .Trim (cleanURL , "/" )
0 commit comments