mac m1安装gowatch
下载安装gowatch
使用命令安装(失败的办法):
go get github.com/silenceper/gowatch
但是报错如下:
zhang@zhangdeMacBook-Pro.local:/usr/local/go/bin $ go get github.com/silenceper/gowatch
package golang.org/x/sys/unix: unrecognized import path "golang.org/x/sys/unix": https fetch: Get "https://golang.org/x/sys/unix?go-get=1": dial tcp 142.251.43.17:443: i/o timeout
# cd /Users/zhang/go/src/github.com/mitchellh; git clone -- https://github.com/mitchellh/go-ps /Users/zhang/go/src/github.com/mitchellh/go-ps
Cloning into '/Users/zhang/go/src/github.com/mitchellh/go-ps'...
fatal: unable to access 'https://github.com/mitchellh/go-ps/': LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443
package github.com/mitchellh/go-ps: exit status 128
网上找的办法:
cd ~/go/src
mkdir -p golang.org/x
cd golang.org/x
git clone https://github.com/golang/sys.git
go get github.com/silenceper/gowatch
但是失败了,go get完全没有任何结果,放弃。
成功的办法
到https://github.com/silenceper/gowatch/releases/tag/v1.5.2-rc.1
选择 gowatch_1.5.2-rc.1_Darwin_x86_64.tar.gz下载:
在访达中打开,双击解压,将里面的gowatch移动到goPATH目录下:
比如说我的go时在/usr/local/go/bin目录下,因此移动gowatch:
sudo mv gowatch /usr/local/go/bin
测试:
gowatch -v
成功✅