DEV Community

George Calianu
George Calianu

Posted on • Edited on

Gopei explained

Basically installing Go working environment means downloading the compiler from https://golang.org, doing some things with PATH and GOPATH (where many people get stuck here) and installing an IDE. There are a lot of tutorials around but let see a smart tool which can make the installation easier.

We talk about Unix/Linux world so make sure you have a Mac or a Linux distro with bash,curl and git installed. If you don't have a github.com account then make yourself one. I typically use it on Ubuntu but Gopei should work on any machine which has bash.

We will use Gopei (Go Programming Environment Installer) toolbox wich is an installer and an customizer for entire Go environment to bring a better experience especially for the new users. Gopei install the Go compiler, LiteIDE (a very lite and quick IDE made for Go language) set PATH, GOPATH and link all together. Also, comes with some tools for github and deploy in the cloud.

Gopei options are well documented on the project wiki page.

First of all download Gopei toolbox from here in your local Downloads folder, unpack it and execute:

Downloads/tools-master/gopei -h

Golang Programming Environment Installer
Usage: gopei [options]
Options:
-c        enable classroom mode (Linux only)
-g        enable git suppport
-h        show this help message and exit
-k        show key fingerprint
-s        server mode, install golang only
-u        uninstall
-U        uninstall including .gitconfig file and .ssh folder
-q [name] set theme (eg. -q webstorm)
-x [name] set color scheme (eg. -x sublime)
-v        version
Enter fullscreen mode Exit fullscreen mode

Basically you will need to go in Downloads folder (but not mandatory) and run:

./gopei
Enter fullscreen mode Exit fullscreen mode

or

./gopei -g
Enter fullscreen mode Exit fullscreen mode

-g is for github. Use it if you want to work with github repositories.

After the installation on some systems you will find a launcher icon with a nice gopher for IDE. On Gnome systems you will need to search in dash for the launcher. On Mac you will find the original IDE icon on dock bar.

If you want to use other IDE (like VSCode, Atom, Sublime or whatever) consider using this command:

./gopei -sg
Enter fullscreen mode Exit fullscreen mode

-s is for server mode (no default IDE). Now you can install your favorite IDE and Go compiler but also Gopei toolbox (like the cloud tool) will be available from your IDE or from Terminal.

Another interesting mode, useful for people who learn, is the classroom mode. Using -c flag any settings you make in the IDE are lost after closing.

Let say now you have many instalations and you want to locate your local key in github keys list. This is hard job because github don't allow you to give a name for each key. So, you can use the following command to see the local machine ssh key fingerprint.

./gopei -k
Enter fullscreen mode Exit fullscreen mode

As you already saw you have two options to uninstall. The main difference is that -U also delete .ssh folder. Uninstall with -u if you want just to update tools.

Another new nice options added in Gopei version 2 are about setting themes designed for big screens. To set the theme from installation use -q and -x flags.

./gopei -g -q webstorm -x sublime
Enter fullscreen mode Exit fullscreen mode

Hope that you found out this tool useful. Enjoy.

Top comments (1)