<p dir="auto">Noticed by accident.  After running go get for an invalid directory, the first <code class="notranslate">go get -u</code> fails, and the second succeeds.  The <code class="notranslate">internal error</code> lines at the end are <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="135222904" data-permission-text="Title is private" data-url="https://github.com/golang/go/issues/14444" data-hovercard-type="issue" data-hovercard-url="/golang/go/issues/14444/hovercard" href="https://github.com/golang/go/issues/14444">#14444</a>.  This issue is about the fact that the two runs of <code class="notranslate">go get -u .../</code> fail in different ways.</p>
<p dir="auto">I haven't looked into it.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="&gt; mkdir /tmp/gopath2
&gt; GOPATH=/tmp/gopath2 go get golang.org/x/tools/cmd/imports   # does not exist
package golang.org/x/tools/cmd/imports: cannot find package &quot;golang.org/x/tools/cmd/imports&quot; in any of:
    /home/iant/go/src/golang.org/x/tools/cmd/imports (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/tools/cmd/imports (from $GOPATH)
&gt; GOPATH=/tmp/gopath2 go get -u .../
/tmp/gopath2/src/golang.org/x/net/html/charset/charset.go:20:2: cannot find package &quot;golang.org/x/text/encoding&quot; in any of:
    /home/iant/go/src/golang.org/x/text/encoding (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/text/encoding (from $GOPATH)
    /tmp/gopath2/src/golang.org/x/net/html/charset/charset.go:21:2: cannot find package &quot;golang.org/x/text/encoding/charmap&quot; in any of:
    /home/iant/go/src/golang.org/x/text/encoding/charmap (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/text/encoding/charmap (from $GOPATH)
/tmp/gopath2/src/golang.org/x/net/html/charset/charset.go:22:2: cannot find package &quot;golang.org/x/text/encoding/htmlindex&quot; in any of:
    /home/iant/go/src/golang.org/x/text/encoding/htmlindex (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/text/encoding/htmlindex (from $GOPATH)
/tmp/gopath2/src/golang.org/x/net/html/charset/charset.go:23:2: cannot find package &quot;golang.org/x/text/transform&quot; in any of:
    /home/iant/go/src/golang.org/x/text/transform (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/text/transform (from $GOPATH)
/tmp/gopath2/src/golang.org/x/net/http2/h2i/h2i.go:38:2: cannot find package &quot;golang.org/x/crypto/ssh/terminal&quot; in any of:
    /home/iant/go/src/golang.org/x/crypto/ssh/terminal (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/crypto/ssh/terminal (from $GOPATH)
&gt; GOPATH=/tmp/gopath2 go get -u .../
internal error: duplicate loads of unsafe
internal error: duplicate loads of runtime/internal/sys
internal error: duplicate loads of runtime/internal/atomic
many other internal errors"><pre class="notranslate"><code class="notranslate">&gt; mkdir /tmp/gopath2
&gt; GOPATH=/tmp/gopath2 go get golang.org/x/tools/cmd/imports   # does not exist
package golang.org/x/tools/cmd/imports: cannot find package "golang.org/x/tools/cmd/imports" in any of:
    /home/iant/go/src/golang.org/x/tools/cmd/imports (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/tools/cmd/imports (from $GOPATH)
&gt; GOPATH=/tmp/gopath2 go get -u .../
/tmp/gopath2/src/golang.org/x/net/html/charset/charset.go:20:2: cannot find package "golang.org/x/text/encoding" in any of:
    /home/iant/go/src/golang.org/x/text/encoding (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/text/encoding (from $GOPATH)
    /tmp/gopath2/src/golang.org/x/net/html/charset/charset.go:21:2: cannot find package "golang.org/x/text/encoding/charmap" in any of:
    /home/iant/go/src/golang.org/x/text/encoding/charmap (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/text/encoding/charmap (from $GOPATH)
/tmp/gopath2/src/golang.org/x/net/html/charset/charset.go:22:2: cannot find package "golang.org/x/text/encoding/htmlindex" in any of:
    /home/iant/go/src/golang.org/x/text/encoding/htmlindex (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/text/encoding/htmlindex (from $GOPATH)
/tmp/gopath2/src/golang.org/x/net/html/charset/charset.go:23:2: cannot find package "golang.org/x/text/transform" in any of:
    /home/iant/go/src/golang.org/x/text/transform (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/text/transform (from $GOPATH)
/tmp/gopath2/src/golang.org/x/net/http2/h2i/h2i.go:38:2: cannot find package "golang.org/x/crypto/ssh/terminal" in any of:
    /home/iant/go/src/golang.org/x/crypto/ssh/terminal (from $GOROOT)
    /tmp/gopath2/src/golang.org/x/crypto/ssh/terminal (from $GOPATH)
&gt; GOPATH=/tmp/gopath2 go get -u .../
internal error: duplicate loads of unsafe
internal error: duplicate loads of runtime/internal/sys
internal error: duplicate loads of runtime/internal/atomic
many other internal errors
</code></pre></div>
<p dir="auto">From:<br>
</p><div class="Box Box--condensed my-2">
  <div class="Box-header f6">
    <p class="mb-0 text-bold">
      <a href="https://github.com/golang/go/blob/ced0646fe5ed9abb3b51fa99748b090f1dfe90e8/src/net/dnsclient.go#L43">go/src/net/dnsclient.go</a>
    </p>
    <p class="mb-0 color-fg-muted">
         Line 43
      in
      <a data-pjax="true" class="commit-tease-sha" href="/golang/go/commit/ced0646fe5ed9abb3b51fa99748b090f1dfe90e8">ced0646</a>
    </p>
  </div>
  <div itemprop="text" class="Box-body p-0 blob-wrapper blob-wrapper-embedded data">
    <table class="highlight tab-size mb-0 js-file-line-container" data-tab-size="8" data-paste-markdown-skip="">

        <tbody><tr class="border-0">
          <td id="L43" class="blob-num border-0 px-3 py-0 color-bg-default" data-line-number="43"></td>
          <td id="LC43" class="blob-code border-0 px-3 py-0 color-bg-default blob-code-inner js-file-line"> <span class="pl-k">if</span> <span class="pl-s1">dns</span>.<span class="pl-c1">rcode</span> <span class="pl-c1">==</span> <span class="pl-s1">dnsRcodeNameError</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s1">dns</span>.<span class="pl-c1">recursion_available</span> { </td>
        </tr>
    </tbody></table>
  </div>
</div>
<p></p>
<p dir="auto">it looks like any NXDOMAIN reply where the server doesn't allow recursive queries is treated as "server misbehaving". I would expect this to be treated like any other case where the name doesn't exist and get a "no such host" error instead.</p>
<p dir="auto">Any reason why we have the "&amp;&amp; dns.recursion_available" part of the condition?</p>