donxbje866688 2019-07-10 13:40
浏览 36
已采纳

在鱼壳上使用`go`

I am struggling with running go in the fish shell.

A) I followed the installation procedure and installed go as specified in the documentation

However, when I run go version, I am getting a fatal error:

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

When I initialize the git by git init, I receive another error:

error: pathspec 'version' did not match any file(s) known to git

I have the paths configured in my fish config as follows:

set -gx GOPATH /home/<user>/go
set -gx PATH $PATH /usr/local/bin/go $GOPATH/bin

where /usr/local/bin/go is an output of which go in both bash and fish


Running it like bash -c 'go version', however, works without any problems (even without the git directory).


B) Also tried gofish and dnf to install go, the same results

Any help is greatly appreciated!


Additional info:

  • Fish version: fish, version 3.0.2
  • Operating system: Linux t460s 5.0.13-300.fc30.x86_64 x86_64 GNU/Linux
  • 写回答

2条回答 默认 最新

  • dongzhui2636 2019-07-10 14:16
    关注

    Could this be some kind of alias that is used instead? The error message is an error from the git binary.

    Take a look in your file ~/.config/fish/config.fish and see if you find an alias there. If you do not find anything there look at the files in ~/.config/fish/ and subfolders.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?