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

在 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 directory

go 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 directory

go 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-build665863426

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/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.go

mkdir -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 上运行良好。


慕娘9325324
浏览 284回答 1
1回答

MMMHUHU

这个问题是在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.amkdir -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导致问题的原因。
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Go