Go Recipes - Gosh Tips

submited by
Style Pass
2021-07-06 14:30:05

This will install the gosh command in the $GOPATH/bin directory (by default: $HOME/go/bin). Make sure you have that directory added to your PATH.

To install the snippets you will need to choose where you want to copy them. Gosh comes with some standard directories which it will search for snippets, the following command will list them:

Choose one of these directories and set the SD shell variable to the directory name (this is just for the purpose of the installation commands below).

The recommended way of installing the snippets is to install the gosh.snippet command and then use that to install the standard snippets. The following command will create the snippet directory if it doesn't already exist and will copy in the standard set of snippets, moving aside any differing snippets of the same name.

If you run it without the install parameter it will just compare the standard snippet set with the contents of the directory you have given. If you are installing the snippets for the first time then it should report them as all being new.

Leave a Comment