0
I've installed a couple of Go utilities via go get -u github.com/[owner]/[repo]
and I don't understand why they don't honor standard shell conventions. The utility I installed had no trace of anything in the directory the command was run from, nor any output indicating anything, so I looked for it via a fairly standard means, and couldn't find it, yet I was always able to run it:
~ $ which hey
~ $ hey
Usage: hey [options...] <url>
Options:
-n Number of requests to run. Default is 200.
-c Number of requests to run concurrently. Total number of requests cannot be smaller than the concurrency level. Default is 50.
[…]
I only figured it out because I noticed that the tail end of my $PATH
includes :~/go/bin
, and sure enough the three go utilities I've installed are present there. Saved me from a long winded find
search.
How do Go installed binaries escape standard file lookup means, yet remain able to run?
This is occurring on a standard bash shell, as shipped with macOS High Sierra (10.13.6).
~ $ type -a hey
hey is /Users/jsalaz/go/bin/hey
~ $ type -a which
which is /usr/bin/which
Assuming it's bash, can you show the output of
type -a hey
and eventype -a which
? – user1686 – 2018-07-13T09:06:43.123I really don't use
type
enough, I think I can count the number of times on one hand. I tend to do direct inspection withls
flags to determine it's attributes. Will definitely storetype -a
away for future use… – VxJasonxV – 2018-07-13T09:09:35.370Attributes? That's... not exactly what
type
is for. – user1686 – 2018-07-13T09:10:17.957