Note that there are some explanatory texts on larger screens.

plurals
  1. POSetting up a Mercurial Repository for Go Packages
    primarykey
    data
    text
    <p>I am struggling to setup a local Mercurial repository for go packages.</p> <p>All mercurial package directories can are under the following url:</p> <pre><code>https://server.example.com/go-packages/ </code></pre> <p>I can clone a package via:</p> <pre><code>hg clone https://server.example.com/go-packages/packagename </code></pre> <p>That works fine.</p> <p>When I want to install the package with the <code>go</code> command line:</p> <pre><code>go get server.example.com/go-packages/packagename </code></pre> <p>I get the following error:</p> <pre><code>package server.example.com/go-packages/packagename: unrecognized import path "server.example.com/go-packages/packagename" </code></pre> <p>But when I do it as explained in <a href="http://golang.org/cmd/go/" rel="nofollow">http://golang.org/cmd/go/</a> :</p> <pre><code>go get server.example.com/go-packages/packagename.hg </code></pre> <p>It works perfectly. </p> <p>In the above document they talk about a <code>&lt;meta&gt;</code> flag. So I created a index.html with the following entry:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;meta name="go-import" content="import-prefix hg repo-root"&gt; &lt;title&gt;packagename&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;packagename&lt;/h1&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <h1>Update:</h1> <p>When I do a <code>wget -O- https://server.example.com/go-packages/packagename/?go-get=1 --no-check-certificate</code> I get:</p> <pre><code>!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;meta name="go-import" content="import-prefix hg repo-root"&gt; &lt;title&gt;packagename&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;packagename&lt;/h1&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <h1>Update 2</h1> <p>I saw, that my content was wrong (copy paste error) now I changed it to:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt; &lt;meta name="go-import" content="server.example.com/go-packages/packagename hg https://server.example.com/go-packages/packagename" /&gt; &lt;title&gt;packagename&lt;/title&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;packagename&lt;/h1&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>Where <code>go-packages</code> is a directory containing the mercurial repository <code>packagename</code>.</p> <p>But still <code>go get server.example.com/go-packages/packagename</code> is not working. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload