gpt4 book ai didi

bash - Go migrate 不会安装在 MacOS 上

转载 作者:行者123 更新时间:2023-12-01 22:43:07 25 4
gpt4 key购买 nike

Mac 操作系统在这里。我在 ~/go 下本地安装了 Go 版本 go1.14.2 darwin/amd64在我的~/.bash_profile我有:

export PATH=$PATH:/usr/local/go/bin
export PATH=$PATH:/Users/myuser/workspace/myproject/repos
export PATH="$GOPATH/bin:$PATH"

export GOPATH=/Users/myuser/workspace/myproject/repos

export PATH=$PATH:/Users/myuser/workspace/myproject/repos/bin
我正在尝试获取 go migrate在职的。当我运行时:
go get -tags 'postgres' -u github.com/golang-migrate/migrate/v4/cmd/migrate
我得到:
$ go migrate
go migrate: unknown command
于是我尝试下载 binary directly off of GitHub并将其复制到 /Users/myuser/workspace/myproject/repos/bin/ :
$ ls -al ~/myuser/myproject/repos/bin/
total 391744
drwxr-xr-x 22 myuser staff 704 Sep 22 12:41 .
drwxr-xr-x 18 myuser staff 576 Aug 20 05:41 ..
-rwxr-xr-x 1 myuser staff 18485484 Jun 15 12:38 dlv
-rwxr-xr-x 1 myuser staff 6790688 Jun 15 12:38 fillstruct
-rwxr-xr-x 1 myuser staff 4588168 Jun 15 12:37 go-outline
-rwxr-xr-x 1 myuser staff 4385080 Jun 15 12:37 go-symbols
-rwxr-xr-x 1 myuser staff 13219700 Jun 15 12:37 gocode
-rwxr-xr-x 1 myuser staff 12768972 Jun 15 12:38 gocode-gomod
-rwxr-xr-x 1 myuser staff 9168808 Jun 15 12:38 godef
-rwxr-xr-x 1 myuser staff 8031416 Jun 15 12:38 godoctor
-rwxr-xr-x 1 myuser staff 5851000 Jun 15 12:38 goimports
-rwxr-xr-x 1 myuser staff 6301816 Jun 15 12:38 golint
-rwxr-xr-x 1 myuser staff 4678536 Jun 15 12:37 gomodifytags
-rwxr-xr-x 1 myuser staff 5448568 Jun 15 12:37 gopkgs
-rwxr-xr-x 1 myuser staff 7438724 Jun 15 12:38 goplay
-rwxr-xr-x 1 myuser staff 6291392 Jun 15 12:37 gorename
-rwxr-xr-x 1 myuser staff 7990696 Jun 15 12:38 goreturns
-rwxr-xr-x 1 myuser staff 13191844 Jun 15 12:37 gotests
-rwxr-xr-x 1 myuser staff 9443888 Jun 15 12:37 guru
-rwxr-xr-x 1 myuser staff 6060712 Jun 15 12:37 impl
-rwxr-xr-x@ 1 myuser staff 41461192 Aug 3 21:34 migrate.darwin-amd64
-rwxr-xr-x 1 myuser staff 7896368 Jun 25 05:27 mockgen
但是,当我运行 go migrate我收到错误:
$ go migrate
go migrate: unknown command
鉴于我在哪里下载了 Go 和我所有的路径设置,我 真的不想改,怎么安装 go migrate成功并使其从命令行工作?

当我运行时:
$ which migrate
$
所以没有安装。

最佳答案

它实际上叫做 migrate ,您可以通过运行 which migrate 查看其位置或 command -v migrate ,或从您的 bin 文件夹中调用二进制文件 migrate.darwin-amd64

关于bash - Go migrate 不会安装在 MacOS 上,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64065595/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com