Not able to watch go files after installing Compile Daemon

1.8k Views Asked by At

Installed using, go get github.com/githubnemo/CompileDaemon and go install github.com/githubnemo/CompileDaemon

When I try to run it using -> CompileDaemon --compile="./folderName"

It gives -> zsh: command not found: CompileDaemon

Note:

  • I'm using oh-my-zsh.
  • My GOPATH and GOBIN are not default one's, I set it to goWorkspace
2

There are 2 best solutions below

4
On

First, don't forget that the use of go get to build and install packages is deprecated (In earlier versions of Go, 'go get' was used to build and install packages. Now, 'go get' is dedicated to adjusting dependencies in go.mod.)

All you need should be go install:

go install github.com/githubnemo/CompileDaemon@latest

That should generate a CompileDaemon executable in your directory named by the GOBIN environment variable.

But you need $GOBIN itself in your $PATH (from your ~/.zshrc for instance):

export PATH="$PATH:$GOBIN"
0
On

Install Compile Daemon using "go install github.com/githubnemo/CompileDaemon@latest"

Important: Ensure that the Compile Daemon executable path(i.e: GOBIN) is included in $PATH.

You can include it by editing your ".bashrc" or ".zshrc" file. or by "export PATH=$PATH:$GOBIN"