Linux配置Golang 依赖包安装
Published on 2020-04-25 20:41 in 分类: Tech / Golang with zgxme
分类: Tech / Golang

Linux配置Golang 依赖包安装

Linux Golang安装

安装版本查看,可自行选择
https://studygolang.com/articles/13957?fr=sidebar
此次选择
go1.14.2.linux-amd64.tar.gz Archive Linux x86-64 118MB 6272d6e940ecb71ea5636ddb5fab3933e087c1356173c61f4a803895e947ebb3

wget https://studygolang.com/dl/golang/go1.14.2.linux-amd64.tar.gz
tar -C /usr/local -zxvf  go1.14.2.linux-amd64.tar.gz
// 习惯用vim,没有的话可以用命令`sudo apt-get install vim`安装一个
vim /etc/profile
// 在最后一行添加
export GOROOT=/usr/local/go
export PATH=$PATH:$GOROOT/bin
// wq保存退出后source一下
source /etc/profile

Golang依赖包安装

go mod init [module]
#具体看看这个
go help mod init
#检查是否安装成功  
go version  
#安装成功后,设置环境变量
go env -w GO111MODULE=on
go env -w GOPROXY="https://mirrors.aliyun.com/goproxy/"

附上一部分go get 下载没反应问题

可以通过ip查询网站
https://www.ipaddress.com/ip-lookup

github.com
github.global.ssl.fastly.net 这两个网站的ip,配置hosts绑定

windows改hosts
C:\Windows\System32\drivers\etc\hosts

linux改hosts
/etc/hosts

posted @   zgxme  阅读(1190)  评论(0编辑  收藏  举报
编辑推荐:
· 没有源码,如何修改代码逻辑?
· 一个奇形怪状的面试题:Bean中的CHM要不要加volatile?
· [.NET]调用本地 Deepseek 模型
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· .NET Core 托管堆内存泄露/CPU异常的常见思路
阅读排行:
· DeepSeek “源神”启动!「GitHub 热点速览」
· 微软正式发布.NET 10 Preview 1:开启下一代开发框架新篇章
· C# 集成 DeepSeek 模型实现 AI 私有化(本地部署与 API 调用教程)
· DeepSeek R1 简明指南:架构、训练、本地部署及硬件要求
· NetPad:一个.NET开源、跨平台的C#编辑器
点击右上角即可分享
微信分享提示