本人也是今天正式开始步入Golang语言的学习,希望大家一起共同学习。
官网地址:https://studygolang.com/dl
Operating system | Architectures | Notes |
---|---|---|
FreeBSD 10.3 or later | amd64, 386 | Debian GNU/kFreeBSD not supported |
Linux 2.6.23 or later with glibc | amd64, 386, arm, arm64, s390x, ppc64le | CentOS/RHEL 5.x not supported. Install from source for other libc. |
macOS 10.10 or later | amd64 | use the clang or gcc† that comes with Xcode‡ forcgo support |
Windows 7, Server 2008R2 or later | amd64, 386 | use MinGW gcc†. No need for cygwin or msys. |
[root@devlop package]# wget https://studygolang.com/dl/golang/go1.12.7.linux-amd64.tar.gz
[root@devlop package]# tar -zxvf go1.12.7.linux-amd64.tar.gz -C /usr/local/
[root@devlop package]# cd /usr/local/go/
[root@devlop go]# ls
api AUTHORS bin CONTRIBUTING.md CONTRIBUTORS doc favicon.ico lib LICENSE misc PATENTS pkg README.md robots.txt src test VERSION
[root@devlop go]# vim /etc/profile
export PATH=$PATH:/usr/local/go/bin
[root@devlop go]# source /etc/profile
[root@devlop ~]# go version
go version go1.12.7 linux/amd64
[root@devlop ~]# mkdir test
[root@devlop ~]# vim test/test.go
package main
import "fmt"
func main() {
fmt.Println("Welcome Golang")
}
[root@devlop ~]# cd test/
[root@devlop test]# go build test.go
编译后会在项目文件夹下生成test可执行文件,并运行该文件
两种方式任选其一:
好了到这里我们我安装结束了。欢迎一起学习Golang ! ! !
创新互联www.cdcxhl.cn,专业提供香港、美国云服务器,动态BGP最优骨干路由自动选择,持续稳定高效的网络助力业务部署。公司持有工信部办法的idc、isp许可证, 机房独有T级流量清洗系统配攻击溯源,准确进行流量调度,确保服务器高可用性。佳节活动现已开启,新人活动云服务器买多久送多久。