Quick Fix: Ubuntu: make: goimports: Command not found

” make: goimports: Command not found ” is an error that appears after installing Go on Ubuntu and then trying to make.

This error appears because the export variables for Go are not set properly. The quick fix is to open and edit ~/.bashrc with this command:

nano ~/.bashrc

Once its opened drop down to the bottom of the file and paste this code for Go:

export PATH=$PATH:/usr/local/go/bin
export GOPATH=$HOME/go;
export PATH=$PATH:$GOPATH/bin;

Press Control (Ctrl) and press X at the same time to exit, Y to save.

Reload the .bashrc file with this:

source ~/.bashrc

This should fix the error and now you can “make” Go packages without errors. Still having an issue? Post below and I will help you!

Have a great day!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.