go mod 安装 gf/cmd 问题

文章目录

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$ 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值