mirror of
https://github.com/healthchecks/healthchecks.git
synced 2024-11-23 07:57:39 +00:00
b9996e63c8
HTML files in /templates/docs/ are not Django templates, they contain HTML content to be used verbatim in hc.front.views.serve_doc view. Some of these files contain "{{ ... }}" syntax. When we run "./manage.py compress", django-compressor trips up on this syntax because it treats them as Django templates. The fix is to change file extension for these files from .html to something else (I picked .html-fragment) so django-compressor would ignore them.
19 lines
2.3 KiB
Plaintext
19 lines
2.3 KiB
Plaintext
<h1>Go</h1>
|
|
<p>Below is an example of making an HTTP request to SITE_NAME from Go.</p>
|
|
<div class="highlight"><pre><span></span><code><span class="kn">package</span><span class="w"> </span><span class="nx">main</span>
|
|
|
|
<span class="kn">import</span><span class="w"> </span><span class="s">"fmt"</span>
|
|
<span class="kn">import</span><span class="w"> </span><span class="s">"net/http"</span>
|
|
<span class="kn">import</span><span class="w"> </span><span class="s">"time"</span>
|
|
|
|
<span class="kd">func</span><span class="w"> </span><span class="nx">main</span><span class="p">()</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="kd">var</span><span class="w"> </span><span class="nx">client</span><span class="w"> </span><span class="p">=</span><span class="w"> </span><span class="o">&</span><span class="nx">http</span><span class="p">.</span><span class="nx">Client</span><span class="p">{</span>
|
|
<span class="w"> </span><span class="nx">Timeout</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="w"> </span><span class="o">*</span><span class="w"> </span><span class="nx">time</span><span class="p">.</span><span class="nx">Second</span><span class="p">,</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
|
|
<span class="w"> </span><span class="nx">_</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">:=</span><span class="w"> </span><span class="nx">client</span><span class="p">.</span><span class="nx">Head</span><span class="p">(</span><span class="s">"PING_URL"</span><span class="p">)</span>
|
|
<span class="w"> </span><span class="k">if</span><span class="w"> </span><span class="nx">err</span><span class="w"> </span><span class="o">!=</span><span class="w"> </span><span class="kc">nil</span><span class="w"> </span><span class="p">{</span>
|
|
<span class="w"> </span><span class="nx">fmt</span><span class="p">.</span><span class="nx">Printf</span><span class="p">(</span><span class="s">"%s"</span><span class="p">,</span><span class="w"> </span><span class="nx">err</span><span class="p">)</span>
|
|
<span class="w"> </span><span class="p">}</span>
|
|
<span class="p">}</span>
|
|
</code></pre></div> |