This is an automated email from the ASF dual-hosted git repository.

dangogh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-trafficcontrol.git

commit c882ba3142bf0c191eda6602efd19c9487fb9f02
Author: Dewayne Richardson <dewr...@apache.org>
AuthorDate: Mon Mar 5 14:39:17 2018 -0700

    removed unnecessary nil checks
---
 traffic_ops/testing/api/v13/session.go | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/traffic_ops/testing/api/v13/session.go 
b/traffic_ops/testing/api/v13/session.go
index b3c6085..90d756a 100644
--- a/traffic_ops/testing/api/v13/session.go
+++ b/traffic_ops/testing/api/v13/session.go
@@ -16,6 +16,7 @@ package v13
 */
 
 import (
+       "fmt"
        "time"
 
        "github.com/apache/incubator-trafficcontrol/traffic_ops/client/v13"
@@ -31,9 +32,6 @@ func SetupSession(toReqTimeout time.Duration, toURL string, 
toUser string, toPas
 
        toReqTimeout = time.Second * 
time.Duration(Config.Default.Session.TimeoutInSecs)
        TOSession, _, err = v13.LoginWithAgent(toURL, toUser, toPass, true, 
"to-api-v13-client-tests", true, toReqTimeout)
-       if err != nil {
-               return err
-       }
        return err
 }
 
@@ -41,21 +39,17 @@ func TeardownSession(toReqTimeout time.Duration, toURL 
string, toUser string, to
        var err error
        toReqTimeout = time.Second * 
time.Duration(Config.Default.Session.TimeoutInSecs)
        TOSession, _, err = v13.LogoutWithAgent(toURL, toUser, toPass, true, 
"to-api-v13-client-tests", true, toReqTimeout)
-       if err != nil {
-               return err
-       }
 
        return err
 }
 
 func SwitchSession(toReqTimeout time.Duration, toURL string, toOldUser string, 
toOldPass string, toNewUser string, toNewPass string) error {
        err := TeardownSession(toReqTimeout, toURL, toOldUser, toOldPass)
+       fmt.Printf("err ---> %v\n", err)
        if err != nil {
                return err
        }
+
        err = SetupSession(toReqTimeout, toURL, toNewUser, toNewPass)
-       if err != nil {
-               return err
-       }
        return err
 }

-- 
To stop receiving notification emails like this one, please contact
dang...@apache.org.

Reply via email to