Home > Blockchain >  Not able to watch go files after installing Compile Daemon
Not able to watch go files after installing Compile Daemon

Time:01-17

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

CodePudding user response:

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"

CodePudding user response:

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"
  • Related