因為新版mac運用了m1芯片,所以golang在debug的時候會有報錯,具體如下:
can not run under rosetta check that the installed build of go is right for your cpu architecture
就是cpu架構的問題,所以我們安裝arm架構的golang版本即可。具體版本見下圖:
下載地址:https://golang.google.cn/dl/go1.17.1.darwin-arm64.pkg
如果用goland也需要下載對應arm架構版本的