当前位置:网站首页>学习 Go 语言 0x01:从官网开始
学习 Go 语言 0x01:从官网开始
2022-04-23 11:02:00 【爱博客大伯】
* Go 语言的官网
这个网址被墙了,因为golang.org只是别名(CNAME),其真实的域名是 golang-consa.l.google.com。ping 这个域名,可以知道:
ping golang.org
正在 Ping golang-consa.l.google.com [216.239.37.1]
google.com在中国还不能访问,所以golang.org也访问不了。
* 为 Go 配置代理
可以为 go get
命令设置代理:
在Windows中
set http_proxy=http://127.0.0.1:46205
set https_proxy=http://127.0.0.1:46205
在linux中,在.bashrc或.profile中设置http_proxy, https_proxy的值。
go get 背后执行的是git clone,所以如果上述代理设置不起作用,可以为git设置代理,如下:
git config --global --add http.proxy http://127.0.0.1:46205
需要注意的是,这个代理是全局的,即你的机器上的git 工程都将走这个代理。
所以,如果不用代理了,要及时删掉,可以执行git config --global -e
,然后 删掉代理即可。
在 Linux中,还可以这样执行 go get
,即在 go get之前加上http_proxy=127.0.0.1:6701
http_proxy=127.0.0.1:6701 go get golang.org/dl/go1.10.7
* 可以在中国访问的Go官网
go 官网 : https://golang.google.cn
go 语言之旅: https://tour.go-zh.org/welcome/1
* 查看 Go 的环境变量
执行 $ go env
可以查看你当前环境中Go相关的环境变量。
* 在Cygwin中使用 Go
在Cygwin中,编译、执行都还正常。
但是,go get命令会有问题,会出现路径错误,可能 go get本身没有考虑到在cygwin中执行。
版权声明
本文为[爱博客大伯]所创,转载请带上原文链接,感谢
https://blog.csdn.net/u013553529/article/details/88833101
边栏推荐
- Let the LAN group use the remote device
- 全栈交叉编译X86完成过程经验分享
- CUMCM 2021-b: preparation of C4 olefins by ethanol coupling (2)
- Problems of class in C # and database connection
- MySQL how to merge the same data in the same table
- Introduction to data analysis 𞓜 kaggle Titanic mission (III) - > explore data analysis
- 全栈交叉编译X86完成过程经验分享
- 学习网站资料
- Anaconda3 installation
- Kaggle - real battle of house price prediction
猜你喜欢
Idea - indexing or scanning files to index every time you start
Mysql8.0安装指南
Solutions to common problems in visualization (VIII) solutions to problems in shared drawing area
Deploy jar package
【leetcode】102. Sequence traversal of binary tree
How does the swagger2 interface import postman
Visual common drawing (I) stacking diagram
CUMCM 2021-B:乙醇偶合制備C4烯烴(2)
关于JUC三大常用辅助类
《Neo4j权威指南》简介,求伯君、周鸿袆、胡晓峰、周涛等大咖隆重推荐
随机推荐
C语言之结构体(进阶篇)
妊娠箱和分娩箱的区别
精彩回顾|「源」来如此 第六期 - 开源经济与产业投资
Microsoft Access database using PHP PDO ODBC sample
Latex usage
Gets the current time in character format
Jupyter lab top ten high productivity plug-ins
MySQL how to merge the same data in the same table
26. 删除有序数组中的重复项
Excel · VBA array bubble sorting function
Software testers, how to mention bugs?
Derivation and regularization
Idea - indexing or scanning files to index every time you start
VIM usage
Image processing - Noise notes
Simple thoughts on the design of a microblog database
Visual Road (XII) detailed explanation of collection class
Using El popconfirm and El backtop does not take effect
remote: Support for password authentication was removed on August 13, 2021.
Strongest date regular expression