A which
or command -v
like tool for Go.
Open a terminal and run the following:
$ go get --ldflags "-s -w" --trimpath -u github.com/mjwhitta/where
$ go install --ldflags "-s -w" --trimpath \
github.com/mjwhitta/where/cmd/where@latest
Or compile from source:
$ git clone https://github.com/mjwhitta/where.git
$ cd where
$ git submodule update --init
$ make
package main
import (
"fmt"
"github.com/mjwhitta/where"
)
func main() {
fmt.Println(where.Is("bash"))
}