mirror of
https://codeberg.org/ultimateplayer1999/go-api-usage.git
synced 2024-11-21 23:18:22 -05:00
Added additional checks for status codes in keystatus
This commit is contained in:
parent
754585842a
commit
571a1bc3a7
10
keystatus.go
10
keystatus.go
@ -61,15 +61,19 @@ func main() {
|
||||
}
|
||||
|
||||
// Print the response
|
||||
if resp.StatusCode == http.StatusOK {
|
||||
if resp.StatusCode == http.StatusOK {
|
||||
fmt.Println("")
|
||||
fmt.Println("Key status: Active")
|
||||
fmt.Println("Key expire fulldate: ", r.KeyexpireString)
|
||||
fmt.Println("Key expire date: ", r.ExpireDate)
|
||||
fmt.Println("")
|
||||
} else {
|
||||
} else if resp.StatusCode == http.StatusUnauthorized {
|
||||
fmt.Println("")
|
||||
fmt.Println("Key status: Expired")
|
||||
fmt.Println("")
|
||||
} else {
|
||||
fmt.Println("")
|
||||
fmt.Println("Recieved a unlisted error.")
|
||||
fmt.Println("")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user