offline go dev on windows

polaris · · 148 次点击    
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
<p>Hello! Could anyone share best practice for subj. I have 2 PC. One for internet and one for dev. </p> <p>Internet PC has no admin rights so no installation. Only portable. </p> <p>Dev PC has no Internet connection. But has admin rights. So install Go env, gogland and so - is not problem.</p> <p>Problem is - any dependancy is a bunch of complecated stuff. May be someone has expirience in this and could help me. E. X. For python I just use &#34;pip download&#34; and it brings me all dependencies</p> <hr/>**评论:**<br/><br/>intermernet: <pre><p>How do you transfer files from the internet PC to the dev PC at the moment? Are they local network connected or do you use USB drives etc?</p> <p>If you&#39;re running &#34;pip download&#34; for python I don&#39;t see why you can&#39;t run &#34;go get&#34; for Go but I may be missing something in your setup.</p> <p>If you can get Go running at all on the internet PC (you can just download the zip file from <a href="" rel="nofollow"></a> and set the GOPATH variable manually) then you should be able to just copy the entire GOPATH from one PC to the other.</p> <p>You shouldn&#39;t really need admin rights at all to develop in Go so you may be able to do everything on your internet PC without manually syncing files to the dev PC.</p></pre>struck-off: <pre><blockquote> <p>How do you transfer files from the internet PC to the dev PC at the moment</p> </blockquote> <p>I have folder-shares over my PCs. I cannot use USB and its not one network, but has sort of internal mechanism for antivirus check etc. I gess I should try protable go. Does it download packages with all deps ? (I gess so but should ask)</p></pre>Sythe2o0: <pre><p>&#34;Go get&#34; is the equivalent to &#34;pip download&#34; here. Have you tried running it? It&#39;s surprising that you&#39;d be able to use pip that way without an internet connection.</p></pre>struck-off: <pre><p>I use pip in internet-PC. It has portable version. </p></pre>jussij: <pre><p>So why not install Go on to that internet-PC?</p> <p>Go can be copy installed, which means it is portable.</p></pre>intermernet: <pre><p>If you currently have folder shares then you may want to look at a portable proxy server on the internet PC and then set the system proxy on the dev PC to point to that. I haven&#39;t had to face this issue in many years, but there should be a few portable proxy apps that you can run on non-privileged ports that will allow you to share the network connection from the internet PC to the dev PC.</p> <p>If you just use the ZIP file and set GOPATH manually on the internet PC you should be able to just do dev normally on the internet PC.</p> <p>If you can share the GOPATH folder between the 2 PCs then you can do all &#34;go get&#34; commands on the internet PC and then develop on the dev PC.</p> <blockquote> <p>Does it download packages with all deps ?</p> </blockquote> <p>Go only comes with the standard library. If you want 3rd party packages you will need to &#34;go get&#34; them.</p></pre>struck-off: <pre><p>I canmot use proxy or what evar coz its no direct access there. So only files. </p></pre>intermernet: <pre><p>Your best bet is to just download and unzip the ZIP version of Go onto the internet PC and set the GOPATH variable. This is effectively a &#34;portable&#34; version of Go. You can then do all dev on the internet PC.</p> <p>You basically unzip the file somewhere and then modify your local &#34;PATH&#34; variable to include the &#34;bin&#34; directory that you just unzipped. This will allow you to run the &#34;go&#34; command from your command prompt (cmd.exe or powershell.exe).</p> <p>You then need to setup the GOPATH. Create a folder that you want to develop your code under (can be anything) and then set a GOPATH environment variable pointing to this folder.</p> <p>You should then be able to use &#34;go get&#34; etc without problems.</p></pre>jussij: <pre><p>There is an official MSI installer: <a href="" rel="nofollow"></a></p></pre>struck-off: <pre><p>As I said. I already have pure go envitonment on dev machine. But get external libs is stikl painful </p></pre>

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

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