after errors in main we should return
Change-Id: Ibe1df859c2d03b1fd882a9dbf5fa468b85c1d089
This commit is contained in:
@@ -31,9 +31,11 @@ func main() {
|
|||||||
config.Password)
|
config.Password)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("There was an error authenticating:", err)
|
fmt.Println("There was an error authenticating:", err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if !auth.Access.Token.Expires.After(time.Now()) {
|
if !auth.Access.Token.Expires.After(time.Now()) {
|
||||||
fmt.Println("There was an error. The auth token has an invalid expiration.")
|
fmt.Println("There was an error. The auth token has an invalid expiration.")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Authenticate with a username, password, tenant name.
|
// Authenticate with a username, password, tenant name.
|
||||||
@@ -43,9 +45,11 @@ func main() {
|
|||||||
config.ProjectName)
|
config.ProjectName)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("There was an error authenticating:", err)
|
fmt.Println("There was an error authenticating:", err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if !auth.Access.Token.Expires.After(time.Now()) {
|
if !auth.Access.Token.Expires.After(time.Now()) {
|
||||||
fmt.Println("There was an error. The auth token has an invalid expiration.")
|
fmt.Println("There was an error. The auth token has an invalid expiration.")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// Authenticate with a username, password, tenant id.
|
// Authenticate with a username, password, tenant id.
|
||||||
@@ -55,8 +59,10 @@ func main() {
|
|||||||
config.ProjectID)
|
config.ProjectID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println("There was an error authenticating:", err)
|
fmt.Println("There was an error authenticating:", err)
|
||||||
|
return
|
||||||
}
|
}
|
||||||
if !auth.Access.Token.Expires.After(time.Now()) {
|
if !auth.Access.Token.Expires.After(time.Now()) {
|
||||||
fmt.Println("There was an error. The auth token has an invalid expiration.")
|
fmt.Println("There was an error. The auth token has an invalid expiration.")
|
||||||
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user