文章目录
go install github.com/gogf/gf/cmd/gf/v2
实际响应
xieruixiangdeMacBook-Pro:demo xieruixiang$ go install github.com/gogf/gf/cmd/gf/v2
no required module provides package github.com/gogf/gf/cmd/gf/v2; to add it:
go get github.com/gogf/gf/cmd/gf/v2
xieruixiangdeMacBook-Pro:demo xieruixiang$ go get github.com/gogf/gf/cmd/gf/v2
go: downloading github.com/gogf/gf/cmd/gf/v2 v2.0.0-20230215061332-ad737ded3cd1
go: github.com/gogf/gf/cmd/gf/v2@v2.0.0-20230215061332-ad737ded3cd1: verifying module: github.com/gogf/gf/cmd/gf/v2@v2.0.0-20230215061332-ad737ded3cd1: checking tree#15596361 against tree#15708872: reading https://goproxy.io/sumdb/sum.golang.org/tile/8/1/237: 404 Not Found
server response: not found
使用编译安装解决,在$GOPATH/src/github.com目录中进行git clone,然后进入其gf/cmd/gf 目录进行 go install
xieruixiangdeMacBook-Pro:github.com xieruixiang$ pwd
/Users/xieruixiang/go/src/github.com
xieruixiangdeMacBook-Pro:github.com xieruixiang$ git clone https://github.com/gogf/gf
Cloning into 'gf'...
remote: Enumerating objects: 65916, done.
remote: Counting objects: 100% (572/572), done.
remote: Compressing objects: 100% (355/355), done.
remote: Total 65916 (delta 243), reused 456 (delta 185), pack-reused 65344
Receiving objects: 100% (65916/65916), 22.49 MiB | 3.55 MiB/s, done.
Resolving deltas: 100% (43637/43637), done.
xieruixiangdeMacBook-Pro:github.com xieruixiang$
xieruixiangdeMacBook-Pro:gf xieruixiang$ pwd
/Users/xieruixiang/go/src/github.com/gf/cmd/gf
xieruixiangdeMacBook-Pro:gf xieruixiang$ go install
最终在bin下生成gf
xieruixiangdeMacBook-Pro:cmd xieruixiang$ pwd
/Users/xieruixiang/go/src/github.com/gf/cmd
xieruixiangdeMacBook-Pro:gf xieruixiang$ go install
xieruixiangdeMacBook-Pro:bin xieruixiang$ pwd
/Users/xieruixiang/go/bin
xieruixiangdeMacBook-Pro:bin xieruixiang$ ls
auth gf godoc gopm kind protoc-gen-go protoc-gen-go-grpc protoc-gen-grpc-gateway protoc-gen-openapiv2 swag
xieruixiangdeMacBook-Pro:bin xieruixiang$ gf -v
GoFrame CLI Tool v2.3.2, https://goframe.org
GoFrame Version: cannot find go.mod
CLI Installed At: /Users/xieruixiang/go/bin/gf
Current is a custom installed version, no installation information.
xieruixiangdeMacBook-Pro:bin xieruixiang$