From bbefc8b791cc0a2e58a166ba71a0ff2ec54db6c5 Mon Sep 17 00:00:00 2001 From: mattyw Date: Mon, 9 Jun 2014 19:22:30 +0100 Subject: [PATCH] after errors in main we should return Change-Id: Ibe1df859c2d03b1fd882a9dbf5fa468b85c1d089 --- examples/00-authentication.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/examples/00-authentication.go b/examples/00-authentication.go index 39ba637..00dc90f 100644 --- a/examples/00-authentication.go +++ b/examples/00-authentication.go @@ -31,9 +31,11 @@ func main() { config.Password) if err != nil { fmt.Println("There was an error authenticating:", err) + return } if !auth.Access.Token.Expires.After(time.Now()) { fmt.Println("There was an error. The auth token has an invalid expiration.") + return } // Authenticate with a username, password, tenant name. @@ -43,9 +45,11 @@ func main() { config.ProjectName) if err != nil { fmt.Println("There was an error authenticating:", err) + return } if !auth.Access.Token.Expires.After(time.Now()) { fmt.Println("There was an error. The auth token has an invalid expiration.") + return } // Authenticate with a username, password, tenant id. @@ -55,8 +59,10 @@ func main() { config.ProjectID) if err != nil { fmt.Println("There was an error authenticating:", err) + return } if !auth.Access.Token.Expires.After(time.Now()) { fmt.Println("There was an error. The auth token has an invalid expiration.") + return } }