From 11c02d89c1b82d2fdc6a7afb4f90e99b1c16aeab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C4=93teris=20Caune?= Date: Thu, 20 Aug 2020 13:56:43 +0300 Subject: [PATCH] Go usage example in docs --- templates/docs/go.html | 19 +++++++++++++++++++ templates/docs/go.md | 23 +++++++++++++++++++++++ templates/front/base_docs.html | 1 + 3 files changed, 43 insertions(+) create mode 100644 templates/docs/go.html create mode 100644 templates/docs/go.md diff --git a/templates/docs/go.html b/templates/docs/go.html new file mode 100644 index 00000000..39da92c8 --- /dev/null +++ b/templates/docs/go.html @@ -0,0 +1,19 @@ +

Go

+

Below is an example of making a HTTP request to SITE_NAME from Go.

+
package main
+
+import "fmt"
+import "net/http"
+import "time"
+
+func main() {
+    var client = &http.Client{
+        Timeout: 10 * time.Second,
+    }
+
+    _, err := client.Head("PING_URL")
+    if err != nil {
+        fmt.Printf("%s", err)
+    }
+}
+
\ No newline at end of file diff --git a/templates/docs/go.md b/templates/docs/go.md new file mode 100644 index 00000000..1c04a10d --- /dev/null +++ b/templates/docs/go.md @@ -0,0 +1,23 @@ +# Go + +Below is an example of making a HTTP request to SITE_NAME from Go. + +```go +package main + +import "fmt" +import "net/http" +import "time" + +func main() { + var client = &http.Client{ + Timeout: 10 * time.Second, + } + + _, err := client.Head("PING_URL") + if err != nil { + fmt.Printf("%s", err) + } +} + +``` diff --git a/templates/front/base_docs.html b/templates/front/base_docs.html index 72391949..95371fe6 100644 --- a/templates/front/base_docs.html +++ b/templates/front/base_docs.html @@ -25,6 +25,7 @@ {% include "front/docs_nav_item.html" with slug="python" title="Python" %} {% include "front/docs_nav_item.html" with slug="ruby" title="Ruby" %} {% include "front/docs_nav_item.html" with slug="php" title="PHP" %} + {% include "front/docs_nav_item.html" with slug="go" title="Go" %} {% include "front/docs_nav_item.html" with slug="csharp" title="C#" %} {% include "front/docs_nav_item.html" with slug="javascript" title="Javascript" %} {% include "front/docs_nav_item.html" with slug="powershell" title="PowerShell" %}