nats-server系统服务只能使用sc命令注册
golang编译-ldflags -H windowsgui被认为是病毒

golang离线环境依赖包问题

妙音 posted @ 2021年8月21日 17:06 in golang , 312 阅读
 

问题描述

 
在一个win10虚拟机中安装了go(go1.16.4)的开发环境, 其中有自己的项目,此时正常编译。
    
然后将这个虚拟机放到内网,内网网络受限,不允许访问外网
    
如果新一个依赖包,该怎么办呢?
 
 
 

方法一: 拷贝vendor目录(推荐)

 
1. 在外网环境项目目录,生成vendor
 
go mod vendor
 
2. 将vendor拷贝进内网,放在内网项目目录
 
 
缺点:只能当前项目使用
 
优点:体积小
 
 
类似python的pip download -r requipment.txt,将包下载后放到一个目录
 
 

方法二: 拷贝$GOPATH/pkg/mod目录

 
1. 外在更新全局依赖
 
go mod download
 
2.拷贝进入内网,替换mod目录
 
优点:可以被所有项目公用
 
缺点:有可能会比较大
 
 

方法三: 使用自己的goproxy

 
详细见
https://github.com/goproxyio/goproxy
 
 
 

吐槽

 
不少资料都是介绍GO111MODULE=on/off/auto之类的查找顺序,看得云山雾绕
 
假如GO111MODULE=on,并且在内网,此时无法访问网络,难道它不会找一下当前目录中的vendor?
 
 
Avatar_small
danske casino 说:
2021年8月21日 23:24

Your work is truly appreciated round the clock and the globe. It is incredibly a comprehensive and helpful blog.

Avatar_small
AAA 说:
2021年9月03日 00:28

I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. магазин интернет магазин

Avatar_small
dfg` 说:
2021年9月04日 22:45

Thank you for such a well written article. It’s full of insightful information and entertaining descriptions. Your point of view is the best among many. Pubg Mobile Mod Apk

Avatar_small
dfg` 说:
2021年9月11日 18:27

i really like this article please keep it up. lions breath carts

Avatar_small
dfg` 说:
2021年9月12日 21:40

I haven’t any word to appreciate this post.....Really i am impressed from this post....the person who create this post it was a great human..thanks for shared this with us. https://barowatt.com

Avatar_small
dfg` 说:
2021年9月13日 18:40

I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. lincoln casino no deposit bonus codes to play

Avatar_small
dfg` 说:
2021年9月13日 23:00

All your hard work is much appreciated. Nobody can stop to admire you. Lots of appreciation. pubg name generator

Avatar_small
dfg` 说:
2021年9月14日 18:41

I was reading some of your content on this website and I conceive this internet site is really informative ! Keep on putting up. Blackpods pro

Avatar_small
dfg` 说:
2021年9月17日 15:15 Thanks for the nice blog. It was very useful for me. I'm happy I found this blog. Thank you for sharing with us,I too always learn something new from your post. Star Network Referral Code
Avatar_small
Hardik 说:
2021年9月17日 17:26

I’m impressed, I must say. Truly rarely must i encounter a weblog that’s both educative and entertaining, and without a doubt, you have hit the nail about the head. Your concept is outstanding; the thing is something too few people are speaking intelligently about. My business is happy that we stumbled across this within my search for some thing relating to this.

Avatar_small
dfg` 说:
2021年9月19日 17:42

hi was just seeing if you minded a comment. i like your website and the thme you picked is super. I will be back. Dangerous Texas Vacation Spots

Avatar_small
dfg` 说:
2021年9月21日 15:55

Wow, excellent post. I'd like to draft like this too - taking time and real hard work to make a great article. This post has encouraged me to write some posts that I am going to write soon. https://muabannhadat.tv/bat-dong-san/tra-vinh

Avatar_small
dfg` 说:
2021年9月21日 22:16

Thanks for providing recent updates regarding the concern, I look forward to read more. blackpods

Avatar_small
dfg` 说:
2021年9月23日 13:39

Excellent article. Very interesting to read. I really love to read such a nice article. Thanks! keep rocking. maltipoo puppies price

Avatar_small
dfg` 说:
2021年9月24日 14:46

Thanks for sharing this valuable content. In my view, if all webmasters and bloggers made good content as you did, the web will be a lot more useful than ever before. Buy Organic Seeds

Avatar_small
dfg` 说:
2021年9月25日 00:26

Unused Kode Redeem FF 2021: Many players like you are looking for Kode Redeem FF Yang Belum Digunakan 2021. Perhaps, not getting the latest ff redeem code. If so, then here is good news for all Free Fire players looking for Free Fire Redeem Code 2021.

Avatar_small
dfg` 说:
2021年9月25日 14:45

Pretty good post. I have just stumbled upon your blog and enjoyed reading your blog posts very much. I am looking for new posts to get more precious info. Big thanks for the useful info. Cheap rottweiler puppies for sale

Avatar_small
dfg` 说:
2021年9月26日 15:40

Your articles are inventive. I am looking forward to reading the plethora of articles that you have linked here. Thumbs up! Salem Voice

Avatar_small
dfg` 说:
2021年9月27日 16:09

Awesome article, it was exceptionally helpful! I simply began in this and I'm becoming more acquainted with it better! Cheers, keep doing awesome! Buy marijuana hash Online UK

Avatar_small
dfg` 说:
2021年9月27日 17:54

Efficiently written information. It will be profitable to anybody who utilizes it, counting me. Keep up the good work. For certain I will review out more posts day in and day out. judi poker

Avatar_small
dfg` 说:
2021年9月27日 21:20

Wow, What an Outstanding post. I found this too much informatics. It is what I was seeking for. I would like to recommend you that please keep sharing such type of info.If possible, Thanks. https://blackpods.org/

Avatar_small
dfg` 说:
2021年9月28日 00:20

Nice blog and absolutely outstanding. You can do something much better but i still say this perfect.Keep trying for the best. moving-local-distance-to-austin

Avatar_small
dfg` 说:
2021年9月28日 00:31

Just admiring your work and wondering how you managed this blog so well. It’s so remarkable that I can't afford to not go through this valuable information whenever I surf the internet! Packing Tips: The Complete List of Dos And Don’ts For Long-Distance Moving

Avatar_small
dfg` 说:
2021年9月28日 00:52

You’ve got some interesting points in this article. I would have never considered any of these if I didn’t come across this. Thanks!. What Is the Average Cost of Moving an Apartment?

Avatar_small
dfg` 说:
2021年9月28日 17:56

Thanks for your insight for your fantastic posting. I’m exhilarated I have taken the time to see this. It is not enough; I will visit your site every day. Top rated businesses

Avatar_small
huram 说:
2021年9月28日 22:43

Below you will understand what is important, the idea provides one of the links with an exciting site: <a href="https://www.thenewcanadians.com/?fbclid=IwAR3_6ZAviXa01yzNp94ajApHUvZANDZL3ENoZO1NTM26P0DbmDHzOqTs7eg">situs idn poker</a>

Avatar_small
Digital_Zone 说:
2021年10月01日 21:33

Fabulous post, you have denoted out some fantastic points, I likewise think this s a very wonderful website. I will visit again for more quality contents and also, recommend this site to all. Thanks. Zonnepanelen installateur Gent

Avatar_small
Digital_Zone 说:
2021年10月01日 21:52

What a sensational blog! This blog is too much amazing in all aspects. Especially, it looks awesome and the content available on it is utmost qualitative. Isolatie spouwmuur

Avatar_small
Digital_Zone 说:
2021年10月01日 22:04

Fabulous post, you have denoted out some fantastic points, I likewise think this s a very wonderful website. I will visit again for more quality contents and also, recommend this site to all. Thanks. Zonnepanelen installateur Gent

Avatar_small
Digital_Zone 说:
2021年10月01日 22:08

You delivered such an impressive piece to read, giving every subject enlightenment for us to gain information. Thanks for sharing such information with us due to which my several concepts have been cleared. SEO Antwerpen

Avatar_small
Digital_Zone 说:
2021年10月01日 22:14

It is a fantastic post – immense clear and easy to understand. I am also holding out for the sharks too that made me laugh. EPS isolatie

Avatar_small
Digital_Zone 说:
2021年10月01日 22:19

I wanted to thank you for this excellent read!! I definitely loved every little bit of it. I have you bookmarked your site to check out the new stuff you post. Webdesign Limburg

Avatar_small
Digital_Zone 说:
2021年10月01日 22:23

Attractive, post. I just stumbled upon your weblog and wanted to say that I have liked browsing your blog posts. After all, I will surely subscribe to your feed, and I hope you will write again soon! Vakantiewoning Limburg

Avatar_small
Digital_Zone 说:
2021年10月01日 22:28

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value. Im glad to have found this post as its such an interesting one! I am always on the lookout for quality posts and articles so i suppose im lucky to have found this! I hope you will be adding more in the future... Zonnepanelen installateur Oost-vlaanderen

Avatar_small
Digital_Zone 说:
2021年10月01日 22:32

I love visiting sites in my free time. I have visited many sites but did not find any site more efficient than yours. Thanks for the nudge! Warmtepompen

Avatar_small
Digital_Zone 说:
2021年10月01日 22:37

I definitely enjoying every little bit of it. It is a great website and nice share. I want to thank you. Good job! You guys do a great blog, and have some great contents. Keep up the good work. Warmtepompen Oost-Vlaanderen

Avatar_small
Digital_Zone 说:
2021年10月01日 22:43

You have done a great job on this article. It’s very readable and highly intelligent. You have even managed to make it understandable and easy to read. You have some real writing talent. Thank you. Terrasoverkappingen op maat

Avatar_small
Digital_Zone 说:
2021年10月01日 22:48

Thank you because you have been willing to share information with us. we will always appreciate all you have done here because I know you are very concerned with our. Airconditioning Oost-Vlaanderen

Avatar_small
Digital_Zone 说:
2021年10月01日 22:53

It is included in my habit that I often visit blogs in my free time, so after landing on your blog. I have thoroughly impressed with it and decided to take out some precious time to visit it again and again. Thanks. Pergola bouwen

Avatar_small
Digital_Zone 说:
2021年10月01日 22:57

Great post but I was wondering if you could write a little more on this subject? I’d be very thankful if you could elaborate a little bit further. Thanks in advance! Web design Limburg

Avatar_small
Digital_Zone 说:
2021年10月01日 23:01

It is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait reading. I am impressed with your work and skill. Thanks. Webdesign bureau

Avatar_small
Digital_Zone 说:
2021年10月01日 23:09

I got too much interesting stuff on your blog. I guess I am not the only one having all the enjoyment here! Keep up the good work. Zonnepanelen installateurs

Avatar_small
dfg` 说:
2021年10月02日 14:36

I have recently started a blog, the info you provide on this site has helped me greatly. Thanks for all of your time & work. https://www.cmacasp.com/news/2

Avatar_small
dfg` 说:
2021年10月02日 18:09

There are various dissertation internet websites on the net when you attain definitely reported with your web page. sash windows

Avatar_small
Digital_Zone 说:
2021年10月07日 07:20

This is a great inspiring article.I am pretty much pleased with your good work.You put really very helpful information. Keep it up. Keep blogging. Looking to reading your next post. facebook login

Avatar_small
Digital_Zone 说:
2021年10月07日 07:47

Wow, excellent post. I'd like to draft like this too - taking time and real hard work to make a great article. This post has encouraged me to write some posts that I am going to write soon. superslot

Avatar_small
dfg` 说:
2021年10月07日 14:47

All your hard work is much appreciated. Nobody can stop to admire you. Lots of appreciation. real estate crowdfunding platform software

Avatar_small
Digital_Zone 说:
2021年10月07日 19:21

It is the kind of information I have been trying to find. Thank you for writing this information. It has proved utmost beneficial for me. ทางเข้า PG SLOT

Avatar_small
Digital_Zone 说:
2021年10月07日 19:35

Yes, I am entirely agreed with this article, and I just want say that this article is very helpful and enlightening. I also have some precious piece of concerned info !!!!!!Thanks. สมัคร UFA

Avatar_small
Digital_Zone 说:
2021年10月07日 19:44

Succeed! It could be one of the most useful blogs we have ever come across on the subject. Excellent info! I’m also an expert in this topic so I can understand your effort very well. Thanks for the huge help. สล็อต999

Avatar_small
Digital_Zone 说:
2021年10月07日 19:54

Yes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks pgslot

Avatar_small
Digital_Zone 说:
2021年10月07日 20:04

Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! Sbobetauto

Avatar_small
Digital_Zone 说:
2021年10月07日 20:13

I would like to thank you for the efforts you have made in writing this article. I am hoping the same best work from you in the future as well. Thanks... ทางเข้า ufabet ภาษาไทย

Avatar_small
Digital_Zone 说:
2021年10月07日 20:36

The website is looking bit flashy and it catches the visitors eyes. Design is pretty simple and a good user friendly interface. pg slot ฝาก ถอน ไม่มี ขั้น ต่ํา

Avatar_small
Digital_Zone 说:
2021年10月07日 20:48

Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. คาสิโน

Avatar_small
Digital_Zone 说:
2021年10月07日 20:57

Thankyou for this wondrous post, I am glad I observed this website on yahoo. sexygame 66

Avatar_small
Digital_Zone 说:
2021年10月07日 21:04

This is such a great resource that you are providing and you give it away for free. I love seeing blog that understand the value of providing a quality resource for free. เครดิตฟรี

Avatar_small
Digital_Zone 说:
2021年10月07日 21:15

Hey, this day is too much good for me, since this time I am reading this enormous informative article here at my home. Thanks a lot for massive hard work. joker

Avatar_small
Digital_Zone 说:
2021年10月07日 21:29

Hey, I am so thrilled I found your blog, I am here now and could just like to say thank for a tremendous post and all round interesting website. Please do keep up the great work. I cannot be without visiting your blog again and again. z8.com games

Avatar_small
Digital_Zone 说:
2021年10月07日 21:36

Fabulous post, you have denoted out some fantastic points, I likewise think this s a very wonderful website. I will visit again for more quality contents and also, recommend this site to all. Thanks. เว็บ ตรง สล็อต 2021

Avatar_small
Digital_Zone 说:
2021年10月07日 21:44

You understand your projects stand out of the crowd. There is something unique about them. It seems to me all of them are brilliant. หุ้นไต้หวัน

Avatar_small
Digital_Zone 说:
2021年10月07日 21:52

You have a real ability for writing unique content. I like how you think and the way you represent your views in this article. I agree with your way of thinking. Thank you for sharing. เว็บหวย

Avatar_small
Digital_Zone 说:
2021年10月07日 22:00

Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! ทางเข้า ufabet

Avatar_small
Digital_Zone 说:
2021年10月07日 22:10

It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. เว็บไม่โกง

Avatar_small
Digital_Zone 说:
2021年10月07日 22:18

This is my first time visit to your blog and I am very interested in the articles that you serve. Provide enough knowledge for me. Thank you for sharing useful and don't forget, keep sharing useful info: เว็บแทงบอล

Avatar_small
Digital_Zone 说:
2021年10月07日 22:25

Nice post. I was checking constantly this blog and I’m impressed! Extremely useful info specially the last part I care for such information a lot. I was seeking this certain info for a long time. Thank you and good luck. slotxoth

Avatar_small
Digital_Zone 说:
2021年10月09日 03:23

What a thrilling post. It is extremely chock-full of useful information. Thanks for such a great info. Game Citadel Paint

Avatar_small
Digital_Zone 说:
2021年10月09日 03:32

Thank you so much as you have been willing to share information with us. We will forever admire all you have done here because you have made my work as easy as ABC. Advertising agency Httpmarketing

Avatar_small
Digital_Zone 说:
2021年10月09日 03:38

Yes, I am entirely agreed with this article, and I just want say that this article is very helpful and enlightening. I also have some precious piece of concerned info !!!!!!Thanks. inceptial review

Avatar_small
Blackpods Pro 说:
2021年10月09日 16:00

thanks for sharing such a beautiful information please keep it
<a href"https://blackpods.org/">Blackpods Pro</a>

Avatar_small
Blackpods Pro 说:
2021年10月09日 16:01

thanks for sharing such a beautiful information please keep it
[url=https://blackpods.org/]Blackpods Pro[/url]

Avatar_small
dfg` 说:
2021年10月09日 20:18

Very good points you wrote here..Great stuff...I think you've made some truly interesting points.Keep up the good work. WhatsApp CRM

Avatar_small
Digital_Zone 说:
2021年10月09日 20:46

There are loads of design companies, so you might have a logical question in mind – Why should I choose to work with Design Factory Decor Company? bedrooms decor

Avatar_small
Digital_Zone 说:
2021年10月09日 23:02

Thanks for the blog filled with so many information. Stopping by your blog helped me to get what I was looking for. Now my task has become as easy as ABC. Rap News

Avatar_small
dfg` 说:
2021年10月10日 21:43

Thank you for another great article. Where else could anyone get that kind of information in such a perfect way of writing? I have a presentation next week, and I am on the look for such information. endreinigung

Avatar_small
Digital_Zone 说:
2021年10月11日 04:46 This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work Sate of Michigan
Avatar_small
Digital_Zone 说:
2021年10月11日 05:06 You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this... Hoxiear
Avatar_small
dfg` 说:
2021年10月11日 17:34

Really I enjoy your site with effective and useful information. It is included very nice post with a lot of our resources.thanks for share. i enjoy this post. pgslot

Avatar_small
Digital_Zone 说:
2021年10月12日 03:45

Fabulous post, you have denoted out some fantastic points, I likewise think this s a very wonderful website. I will visit again for more quality contents and also, recommend this site to all. Thanks. Battlefield 5

Avatar_small
Digital_Zone 说:
2021年10月12日 04:08

It is truly a well-researched content and excellent wording. I got so engaged in this material that I couldn’t wait reading. I am impressed with your work and skill. Thanks. <a href="https://sites.google.com/view/funnygamingscomfunnygaming/หนาแรก">TAR CONFLICT FIRST LOOK</a>

Avatar_small
Digital_Zone 说:
2021年10月12日 04:17

I am incapable of reading articles online very often, but I’m happy I did today. It is very well written, and your points are well-expressed. I request you warmly, please, don’t ever stop writing. Battlefield 5

Avatar_small
Digital_Zone 说:
2021年10月12日 04:25

It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. TAR CONFLICT FIRST LOOK

Avatar_small
Digital_Zone 说:
2021年10月12日 04:35

nice post, keep up with this interesting work. It really is good to know that this topic is being covered also on this web site so cheers for taking time to discuss this! SHAMAN KING SEASON 1

Avatar_small
Digital_Zone 说:
2021年10月12日 04:45

Best work you have done, this online website is cool with great facts and looks. I have stopped at this blog after viewing the excellent content. I will be back for more qualitative work. TAR CONFLICT FIRST LOOK

Avatar_small
Digital_Zone 说:
2021年10月12日 04:52

Thank you so much as you have been willing to share information with us. We will forever admire all you have done here because you have made my work as easy as ABC. SHAMAN KING SEASON 1

Avatar_small
Digital_Zone 说:
2021年10月12日 04:59

Very interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know. TAR CONFLICT FIRST LOOK

Avatar_small
Digital_Zone 说:
2021年10月12日 05:08

I’m going to read this. I’ll be sure to come back. thanks for sharing. and also This article gives the light in which we can observe the reality. this is very nice one and gives indepth information. thanks for this nice article... SHAMAN KING SEASON 1

Avatar_small
Digital_Zone 说:
2021年10月12日 05:15

Took me time to read all the comments, but I really enjoyed the article. It proved to be Very helpful to me and I am sure to all the commenters here! It’s always nice when you can not only be informed, but also entertained! TAR CONFLICT FIRST LOOK

Avatar_small
dfg` 说:
2021年10月12日 17:15

I read a article under the same title some time ago, but this articles quality is much, much better. How you do this.. 먹튀폴리스

Avatar_small
Digital_Zone 说:
2021年10月13日 05:47 This article gives the light in which we can observe the reality. This is very nice one and gives indepth information. Thanks for this nice article. Soloprime
Avatar_small
Digital_Zone 说:
2021年10月13日 05:54

Thank you so much as you have been willing to share information with us. We will forever admire all you have done here because you have made my work as easy as ABC. Trade Firm blog click here

Avatar_small
dfg` 说:
2021年10月14日 13:44

Remarkable article, it is particularly useful! I quietly began in this, and I'm becoming more acquainted with it better! Delights, keep doing more and extra impressive! Latest rap news

Avatar_small
dfg` 说:
2021年10月14日 15:45

It is a great website.. The Design looks very good.. Keep working like that!. lottery

Avatar_small
Digital_Zone 说:
2021年10月15日 03:55

Gulf Bridge International(GBI) is a global cloud, connectivity and content enabler. We are a carrier’s carrier with working within Qatar’s Telecom sector. Our multilayer terrestrial and subsea cable meshed network bridges the East to the West through Middle East. Gulf Bridge International offers a wide range of products and services including but not limited to GCC Connectivity products, Data Centre Connectivity and Azure ExpressRoute. GBI is dedicated to turning the region into a global connectivity hub. Data Centre Connectivity

Avatar_small
Digital_Zone 说:
2021年10月15日 04:14

It is my first visit to your blog, and I am very impressed with the articles that you serve. Give adequate knowledge for me. Thank you for sharing useful material. I will be back for the more great post. Buy Hotmail Accounts

Avatar_small
Digital_Zone 说:
2021年10月15日 04:16

Pretty nice post. I just stumbled upon your weblog and wanted to say that I have really enjoyed browsing your blog posts. After all I’ll be subscribing to your feed and I hope you write again soon! Buy Bulk Gmail Accounts

Avatar_small
Digital_Zone 说:
2021年10月15日 04:25

The environment is vibrant, alive, and welcoming to all. Drop by and see for yourself what The Tropicanna Life is all about. Some things are worth celebrating. Legal Cannabis is one of them. https://thetropicannalife.com/

Avatar_small
Digital_Zone 说:
2021年10月15日 04:34

Positive site, where did u come up with the information on this posting? I'm pleased I discovered it though, ill be checking back soon to find out what additional posts you include. wood cnc machine 4x8

Avatar_small
dfg` 说:
2021年10月16日 21:42

Im no expert, but I believe you just made an excellent point. You certainly fully understand what youre speaking about, and I can truly get behind that. 핀벳88먹튀

Avatar_small
Dr.Billa 说:
2021年10月18日 04:44

Great work✅ This is the type of information that should be shared around the web. I also have some information related to on my website✅ emirates flights


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter