为了账号安全,请及时绑定邮箱和手机立即绑定

尝试安装时在 Mac OS X 中失败

尝试安装时在 Mac OS X 中失败

Go
慕娘9325324 2022-01-17 20:01:04
在 Mac OS X 上,尝试go get执行以下命令。它因以下错误而失败:-jabongs-MacBook-Pro-4:florest debraj$ go get ./...go install github.com/jabong/florest/src/common/config: open /var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/go-build823644730/github.com/jabong/florest/src/common/config.a: no such file or directorygo install github.com/jabong/florest/src/common/utils/responseheaders: open /var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/go-build823644730/github.com/jabong/florest/src/common/utils/responseheaders.a: no such file or directorygo install github.com/jabong/florest/src/service: open /var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/go-build823644730/github.com/jabong/florest/src/service.a: no such file or directory以下是使用-x标志的输出:-jabongs-MacBook-Pro-4:florest debraj$ go get -x ./...WORK=/var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/go-build665863426mkdir -p $WORK/github.com/jabong/floRest/src/examples/_obj/mkdir -p $WORK/github.com/jabong/floRest/src/cd /Users/debraj/golang/src/github.com/jabong/floRest/src/examples/usr/local/go/pkg/tool/darwin_amd64/compile -o $WORK/github.com/jabong/floRest/src/examples.a -trimpath $WORK -p github.com/jabong/floRest/src/examples -complete -buildid febe48d3c570d8539844891977fbdc206dc458b4 -D _/Users/debraj/golang/src/github.com/jabong/floRest/src/examples -I $WORK -I /Users/debraj/golang/pkg/darwin_amd64 -pack ./api_definition.go ./data_structures.go ./hello_world.go ./hello_world_health_checker.go ./hello_world_multipe_errors.go ./swagger.gomkdir -p $WORK/github.com/jabong/floRest/src/service/_obj/mkdir -p $WORK/github.com/jabong/florest/src/examples/_obj/mkdir -p $WORK/github.com/jabong/florest/src/cd /Users/debraj/golang/src/github.com/jabong/floRest/src/service有人可以让我知道为什么会出现这个错误吗?这在 Ubuntu 上运行良好。
查看完整描述

1 回答

?
MMMHUHU

TA贡献1834条经验 获得超8个赞

这个问题是在golang-nuts讨论后发现的。只是在下面再次引用它:-

我的猜测是因为 Mac 文件系统保留大小写但不区分大小写,这意味着在 mac os 中“floRest”和“florest”是同一个文件/目录,而在 linux 上它们是 2 个不同的文件。(您也可以将 mac 文件系统配置为区分大小写,但这不是默认设置)。

正如您在日志中看到的:

mv $WORK/github.com/jabong/floRest/src/examples.a /Users/debraj/golang/pkg/darwin_amd64/github.com/jabong/floRest/src/examples.a

mkdir -p /Users/debraj/golang/pkg/darwin_amd64/github.com/jabong/florest/src/

cp $WORK/github.com/jabong/florest/src/examples.a /Users/debraj/golang/pkg/darwin_amd64/github.com/jabong/florest/src/examples.a

去安装github.com/jabong/florest/src/examples:打开/var/folders/lp/3q9_2mn51hd9s4yj_jcf3jxm0000gp/T/go-build665863426/github.com/jabong/florest/src/examples.a:没有这样的文件或目录

文件“floRest/src/examples.a”被移动,然后尝试复制“florest/src/examples.a”,这是mac os上的同一个文件,它不再存在。

为了克隆我使用的 repo:-

git clone https://github.com/jabong/florest/

因此,在 mac 中,我的代码在目录中签出florest。但是实际的仓库名称是https://github.com/jabong/floRest/并且在代码中它被引用为floRest导致问题的原因。


查看完整回答
反对 回复 2022-01-17
  • 1 回答
  • 0 关注
  • 283 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号