From 3d9261c7c41590ee02b0ccfcd4329adb12e6b0bd Mon Sep 17 00:00:00 2001 From: omurbekjk Date: Thu, 3 Oct 2019 17:22:36 +0600 Subject: [PATCH 1/2] feature: golang code snippet added --- templates/front/snippets/go.html | 4 ++++ templates/front/snippets/go.txt | 9 +++++++++ templates/front/welcome.html | 3 +++ 3 files changed, 16 insertions(+) create mode 100644 templates/front/snippets/go.html create mode 100644 templates/front/snippets/go.txt diff --git a/templates/front/snippets/go.html b/templates/front/snippets/go.html new file mode 100644 index 00000000..3f72e0d2 --- /dev/null +++ b/templates/front/snippets/go.html @@ -0,0 +1,4 @@ +
import "net/http"
+import "fmt"
+func main() { _, err := http.Get("PING_URL") }
+
diff --git a/templates/front/snippets/go.txt b/templates/front/snippets/go.txt new file mode 100644 index 00000000..8f1cbb19 --- /dev/null +++ b/templates/front/snippets/go.txt @@ -0,0 +1,9 @@ +import "fmt" +import "net/http" + +func main() { + _, err := http.Get("PING_URL") + if err != nil { + fmt.Printf("%s", err) + } +} diff --git a/templates/front/welcome.html b/templates/front/welcome.html index 5cbe9df7..1ec27d4c 100644 --- a/templates/front/welcome.html +++ b/templates/front/welcome.html @@ -62,6 +62,9 @@ + From fbc217ef3572a8e8921cfc96da38fb0f0b25c667 Mon Sep 17 00:00:00 2001 From: omurbekjk Date: Mon, 7 Oct 2019 16:55:09 +0600 Subject: [PATCH 2/2] feature: golang http get request changes to head --- templates/front/snippets/go.html | 2 +- templates/front/snippets/go.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/front/snippets/go.html b/templates/front/snippets/go.html index 3f72e0d2..83d9f599 100644 --- a/templates/front/snippets/go.html +++ b/templates/front/snippets/go.html @@ -1,4 +1,4 @@
import "net/http"
 import "fmt"
-func main() { _, err := http.Get("PING_URL") }
+func main() { _, err := http.Head("PING_URL") }
 
diff --git a/templates/front/snippets/go.txt b/templates/front/snippets/go.txt index 8f1cbb19..4b1c1bc0 100644 --- a/templates/front/snippets/go.txt +++ b/templates/front/snippets/go.txt @@ -2,7 +2,7 @@ import "fmt" import "net/http" func main() { - _, err := http.Get("PING_URL") + _, err := http.Head("PING_URL") if err != nil { fmt.Printf("%s", err) }