Merge branch '16723-kill-vs-requeue'
[arvados.git] / sdk / go / arvadosclient / arvadosclient.go
index 91da5a3fd62ce6eb099e4ce0c0e206a1220268ae..bfcbde2a70632a170734e2664683223f4740d695 100644 (file)
@@ -24,7 +24,7 @@ import (
        "sync"
        "time"
 
-       "git.curoverse.com/arvados.git/sdk/go/arvados"
+       "git.arvados.org/arvados.git/sdk/go/arvados"
 )
 
 type StringMatcher func(string) bool
@@ -70,12 +70,11 @@ func (e APIServerError) Error() string {
                        e.HttpStatusCode,
                        e.HttpStatusMessage,
                        e.ServerAddress)
-       } else {
-               return fmt.Sprintf("arvados API server error: %d: %s returned by %s",
-                       e.HttpStatusCode,
-                       e.HttpStatusMessage,
-                       e.ServerAddress)
        }
+       return fmt.Sprintf("arvados API server error: %d: %s returned by %s",
+               e.HttpStatusCode,
+               e.HttpStatusMessage,
+               e.ServerAddress)
 }
 
 // StringBool tests whether s is suggestive of true. It returns true
@@ -173,8 +172,11 @@ func New(c *arvados.Client) (*ArvadosClient, error) {
                ApiServer:   c.APIHost,
                ApiToken:    c.AuthToken,
                ApiInsecure: c.Insecure,
-               Client: &http.Client{Transport: &http.Transport{
-                       TLSClientConfig: MakeTLSConfig(c.Insecure)}},
+               Client: &http.Client{
+                       Timeout: 5 * time.Minute,
+                       Transport: &http.Transport{
+                               TLSClientConfig: MakeTLSConfig(c.Insecure)},
+               },
                External:          false,
                Retries:           2,
                KeepServiceURIs:   c.KeepServiceURIs,
@@ -417,9 +419,8 @@ func (c *ArvadosClient) Discovery(parameter string) (value interface{}, err erro
        value, found = c.DiscoveryDoc[parameter]
        if found {
                return value, nil
-       } else {
-               return value, ErrInvalidArgument
        }
+       return value, ErrInvalidArgument
 }
 
 func (ac *ArvadosClient) httpClient() *http.Client {