0

I made a mistake of installing some tool dependent on Go and it somehow redefined my go executable to /usr/local/bin/go from /usr/local/go/bin/go. I deleted the /usr/local/bin/go, cleaned the paths, called

eval `/usr/libexec/path_helper -s`

And it helped. But after every restart the problem mysteriously reappears. The go is in path, seen by which but when I call it, it goes to a wrong (deleted) executable.

$ which go
/usr/local/go/bin/go
$ go
-bash: /usr/local/bin/go: No such file or directory

The /etc/paths.d does not have anything interesting:

$ ls -l /etc/paths.d
total 16
-rwxr-xr-x  1 root  wheel  23 Nov 17 16:45 100-rvictl
-rw-r--r--  1 root  wheel  13 Oct 26  2016 40-XQuartz

Alias is not defined:

$ alias
alias gohome='cd $GOHOME'

Nothing interesting in .bash_profile. I can get around the problem but I would rather fix the source. Any suggestions as to where to look? Thanks!

This is macOS 11.3, bash (not zsh).

Update:

$ type go
go is hashed (/usr/local/go/bin/go)

This is after I ran eval `/usr/libexec/path_helper -s` .

muru
  • 72,889
Gene S
  • 101

0 Answers0