<p>When I ran <a href="https://github.com/knq/usql"><code>go get -u https://github.com/knq/usql</code></a>, trying to install a program that was recently posted here, I received these error messages:</p>
<pre><code>package github.com/go-sql-driver/mysql: remote origin not found
package github.com/lib/pq: remote origin not found
</code></pre>
<p>I could <code>go get</code> each of these packages manually, but I still got the error messages when running the above command. So I went into the appropriate directories (<code>$GOPATH/src/github.com/lib</code> and <code>$GOPATH/src/github.com/go-sql-driver/mysql</code>), deleted everything, and then ran <code>git clone https://github.com/go-sql-driver/mysql.git</code> etcetera. Now <code>go get -u</code> runs fine.</p>
<p>What's going on here? Are repositories required to specify their origin in some settings file so <code>go get</code> can locate it?</p>
<hr/>**评论:**<br/><br/>ar1819: <pre><p>Add -v and -x flags so you could at least see what's happening. </p></pre>Fwippy: <pre><p>I'm not sure. It Worked On My Machine just now - perhaps you had a momentary network hiccup?</p></pre>NeverUse-YouPromised: <pre><p>It happened on two separate occasions and is reliably reproducible. I don't think my network has anything to do with it.</p></pre>j_d_q: <pre><p>Might you have removed the .git folder? From the error, it appears they can't find where to fetch from</p></pre>NeverUse-YouPromised: <pre><p>I didn't touch the repositories; I just let Go do its thing. After the command of paragraph 1, I ran <code>git status</code> to check the repositories and they weren't git repositories. It's as if <code>go get</code> just raw-downloaded the files.</p></pre>PsyWolf: <pre><p>In that case, the easiest thing to do would be to just delete those packages from your GOPATH and then the commands should work as expected. </p>
<p>Not sure how/why the .git folder isn't there. The go tool always does a normal clone afaik.</p></pre>NeverUse-YouPromised: <pre><p>Like I said in the question, I did, and when I did that, it worked. However, if I delete the dependencies and run <code>go get -u</code> on the original project, the problem re-appears.</p>
<p>Edit: and somehow it doesn't now. What a weird problem.</p></pre>PsyWolf: <pre><p>It's possible some other tool like godep or glide might be pruning out unnecessary files including the .git folder? It wouldn't be the weirdest feature ever.</p></pre>NeverUse-YouPromised: <pre><p>I don't use any dependency tool.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传