Go 1.17.6环境搭建 for Mac

1,brew install go;

lanyuan@lanyuans-MacBook-Pro apache-maven-3.8.4 % brew install go   

Running `brew update --preinstall`...

go 1.17.2 is already installed but outdated (so it will be upgraded).

==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/go-1.17.6.monterey.bottle.tar.gz

curl: (22) The requested URL returned error: 404                              

Warning: Bottle missing, falling back to the default domain...

==> Downloading https://ghcr.io/v2/homebrew/core/go/manifests/1.17.6

######################################################################## 100.0%

==> Downloading https://ghcr.io/v2/homebrew/core/go/blobs/sha256:c81555a115fbd99ab1c74e9b3e1d056864c31a4274803381230984f4a70fdf63

==> Downloading from https://pkg-containers.githubusercontent.com/ghcr1/blobs/sha256:c81555a115fbd99ab1c74e9b3e1d056864c31a4274803381230984f4a70fdf63?se

######################################################################## 100.0%

==> Upgrading go

  1.17.2 -> 1.17.6

==> Pouring go--1.17.6.monterey.bottle.tar.gz

🍺  /usr/local/Cellar/go/1.17.6: 10,826 files, 565.9MB

==> Running `brew cleanup go`...

Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.

Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

Removing: /usr/local/Cellar/go/1.17.2... (10,814 files, 565.8MB)

安装确认:go env

2,测试例子:

vi app.go

package main

import "fmt"

func main() {
    fmt.Println("hello world")
}

:wq退出;

go build 

./helloworld

如果环境有问题,检查go env。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值