16636: a-d-c: add two more metrics:
[arvados.git] / lib / controller / rpc / conn.go
index 729d8bdde09e7ee05d2766ef0a4d1ee72f01a8d1..cd98b64718a0b1f52702f4997f432d3d5210f353 100644 (file)
@@ -26,11 +26,11 @@ import (
 type TokenProvider func(context.Context) ([]string, error)
 
 func PassthroughTokenProvider(ctx context.Context) ([]string, error) {
-       if incoming, ok := auth.FromContext(ctx); !ok {
+       incoming, ok := auth.FromContext(ctx)
+       if !ok {
                return nil, errors.New("no token provided")
-       } else {
-               return incoming.Tokens, nil
        }
+       return incoming.Tokens, nil
 }
 
 type Conn struct {
@@ -170,9 +170,8 @@ func (conn *Conn) relativeToBaseURL(location string) string {
                u.User = nil
                u.Host = ""
                return u.String()
-       } else {
-               return location
        }
+       return location
 }
 
 func (conn *Conn) CollectionCreate(ctx context.Context, options arvados.CreateOptions) (arvados.Collection, error) {