We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
通过这篇文章,可以方便初学者对Golang有个快速的了解。
本文中章节的内容都分为2部分:
The text was updated successfully, but these errors were encountered:
1.1、安装Golang
以Linux为例,
# 下载 wget https://golang.org/dl/go1.15.3.src.tar.gz # 安装 sudo tar -C /usr/local -xzf go1.15.3.linux-amd64.tar.gz
1.2、环境变量配置
在1.1章节,只是把Golang的源码解压到指定的目录下,接下来需要配置Go中两个比较重要的环境变量。
/usr/local/go
$HOME/GOPATH
在指定的SHELL配置文件中,配置环境变量。我本机使用的是bash,则在$HOME/.bashrc的底部增加下面配置项。
$HOME/.bashrc
export GOROOT=/usr/local/go export GOPATH=$HOME/GOPATH export PATH=$GOROOT/bin:$GOPATH/bin:$PATH
1.3、测试安装
配置好1.2后,重新加载bash配置,然后测试。
# 重新加载bash,使刚才配置的配置文件生效 bash # 测试golang的安装 go version
Sorry, something went wrong.
个人常用vscode写代码,所以就围绕vscode介绍我的开发环境。
2.1、vscode下载安装: 官网下载
2.2、vscode插件推荐:
2.3、vscode配置:
安装完vscode-go后,Mac下面按Shife+Command+P,输入Go Install进行搜索,选择Go: Install/Update Tools进行Go Tools安装,
vscode-go
Shife+Command+P
Go Install
Go: Install/Update Tools
勾选全部,安装所有的插件。
2.4、远程开发(可选,强烈推荐)
对于开发人员,往往配置的有远程的开发机,这个时候就需要用到远程开发的工具。对于远程开发来说,往往有下列流派:
No branches or pull requests
通过这篇文章,可以方便初学者对Golang有个快速的了解。
本文中章节的内容都分为2部分:
The text was updated successfully, but these errors were encountered: