We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 30a1918 commit 3551884Copy full SHA for 3551884
1 file changed
cmd/debug.go
@@ -3,6 +3,7 @@ package cmd
3
import (
4
"fmt"
5
"log"
6
+ "net/http"
7
"os"
8
"runtime"
9
@@ -45,6 +46,17 @@ func Debug(ctx *cli.Context) {
45
46
fmt.Println("Config file: <not configured>")
47
fmt.Println("API Key: <not configured>")
48
}
- fmt.Printf("API: %s\n", c.API)
49
+ fmt.Printf("API: %s [%s]\n", c.API, pingUrl(c.API))
50
+ fmt.Printf("XAPI: %s [%s]\n", c.XAPI, pingUrl(c.XAPI))
51
fmt.Printf("Exercises Directory: %s\n", c.Dir)
52
53
+
54
+func pingUrl(url string) string {
55
+ res, err := http.Get(url)
56
+ if err != nil {
57
+ return err.Error()
58
+ }
59
+ defer res.Body.Close()
60
61
+ return "connected"
62
+}
0 commit comments