go not a recognized command?

polaris · · 869 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>So when I type in go version to see if go was correctly installed, my terminal shell (git shell) says that it cannot recognize the command. I even tried using it in different directories but the command it self will not work.</p> <p>Am I doing something wrong or what should I do in order to use the go commands?</p> <hr/>**评论:**<br/><br/>bbrazil: <pre><p>It&#39;s probably not in your path. Presuming <code>GOROOT</code> is set, try:</p> <pre><code>export PATH=&#34;$GOROOT/bin:$PATH&#34; </code></pre></pre>showdo97: <pre><p>What directory should I be in in order to execute that line? My hard drive or where go is installed?</p></pre>bbrazil: <pre><p>Anywhere, this is setting environment variables for your shell.</p></pre>nanodano: <pre><p>Sounds like you are in Windows. Go to System -&gt; Advaned properties -&gt; environment variables and update your PATH to include the Go bin dir.</p></pre>touristtam: <pre><p>or do yourself a favor and install Rapid Environment Editor (for windows) <a href="http://www.rapidee.com/en/about" rel="nofollow">http://www.rapidee.com/en/about</a></p></pre>readthefuckingwiki: <pre><p>Dude...</p> <p>What OS? How did you install it? Literally any information that we could use to help you.</p> <p>Anyway, &#34;git shell&#34; probably means &#34;I installed Git and got Git Bash and I&#39;m calling it &#34;git shell&#34;.</p> <p>So yeah, you have a bash shell. Cool. ... Git... doesn&#39;t come with Golang, so I&#39;m not sure why you&#39;d expect it to just work.</p></pre>touristtam: <pre><p>This sound like a Git install for a Windows computer. In which case, the git installer came with its own bash. Anyway OP should really have asked its favorite search engine to crawl for an answer on a well known technical website, like StackOverflow instead of Reddit:</p> <p><a href="https://duckduckgo.com/?q=go%20is%20not%20a%20recognized%20command%3F+site:stackoverflow.com" rel="nofollow">https://duckduckgo.com/?q=go%20is%20not%20a%20recognized%20command%3F+site:stackoverflow.com</a></p></pre>readthefuckingwiki: <pre><p>I mean, OP should realize that neither Windows, nor Git comes with Go.</p> <p>The Go team provides MSI installers. But more over, the OP is also confused about &#34;which dir&#34; to set an environment variable in.</p> <p>I kinda feel like an even more fundamental approach is needed, but god knows I&#39;m not signing up for intro-to-go-dev-on-windows. :(</p></pre>touristtam: <pre><p>Ye I agree with you, that the question sounds like OP lacks some knowledge. I think it s partially the Go team fault for providing that installer. Otherwise the difficulties arising from encountering a manually installation (on Windows specially) would have ironed out such a trivial question. At least this is my opinion. ;)</p></pre>

入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889

869 次点击  
加入收藏 微博
暂无回复
添加一条新回复 (您需要 登录 后才能回复 没有账号 ?)
  • 请尽量让自己的回复能够对别人有帮助
  • 支持 Markdown 格式, **粗体**、~~删除线~~、`单行代码`
  • 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
  • 图片支持拖拽、截图粘贴等方式上传