Mahdi.Kh
September 17, 2026
To work with any programming language, we need a development environment. Here, we install Go, introduce some tools you can use alongside Go, and finally write our first program.
To set up a development environment for the Go (Golang) programming language, we'll go through the following steps:
To install Go, you can download the latest version suited to your operating system from Go's official site and install it following the provided instructions.
You can write your Go programs using any modern text editor.
There are various editors out there; some are very simple and just let you write plain text, while others provide more advanced capabilities.
For example, let's go over a few of the most important features that more advanced editors provide:
IntelliSense: when you start typing code, you get suggestions for completing the word or line you're writing.
Linting: using this feature, your code's structure is checked and formatted against certain standards before saving (or whenever you want).
Debugging: while debugging, you can mark any part of the code and then run it. The debugger's execution can be controlled at the lines you've marked. For example, you can stop the program at a specific line and inspect the contents of memory and the currently running statements at that exact moment. This approach lets you troubleshoot and fix potential issues.
AI plugins: the ability to install and use AI plugins! These plugins can help you write better code.
Next, we'll look at a few of the most well-known IDEs and editors out there.
Visual Studio Code is one of the most popular text editors, developed by Microsoft. It's lightweight and extensible through plugins.
This editor is free and open source (you can see its code here), which is why a lot of people use it.
Goland is a commercial IDE made specifically for the Go language, developed by JetBrains. This IDE includes almost every tool you need for Go development.
Goland isn't free, but if you're a teacher or a student, or you contribute to open-source projects, you can apply for a free license, and after review, if you qualify, you'll be given one.
You can download Goland from the JetBrains site and try it out for a 30-day trial.
Sublime Text is a lightweight, fast text editor that offers many capabilities through plugins. If you're looking for a lightweight, handy text editor, I'd recommend Sublime Text.
You can download and install this editor from its own site and use it for free; also, if you're going to use it very heavily, you can buy a license for it, though it still works without one.
Choosing the best editor or IDE depends on your own needs and preferences. If you're looking for a lightweight, extensible editor, Visual Studio Code is a great option. If you're looking for a full-featured IDE with advanced capabilities, Goland is a good choice. Text editors like Sublime Text are also a good fit for those looking for a lightweight development environment.
To create a Go program, just create a folder with whatever name you like (here, for example, we'll create helloworld), and then create a file named main.go inside that folder.
Now write the code below inside it:
Here, we wrote a program that prints the text Hello World! to the screen.
To run the code above, just run the go run main.go command in the project folder. The result will be as follows:
The go run command compiles and runs the program instantly. If you want to have the compiled file, just use the command below:
After running the command above, our code is compiled and given to you as a file named app. Now you can run it as follows and see the result:
Congratulations, you've written and run your first Go program =) Everything starts here!
Right now you might not know exactly what the code we wrote is or how it works! But over time you'll get familiar with all the code's points and details.
You can find the code we've written so far at the path below:
So far, we've learned how to set up our Go development environment, and we've also written our first Go program; next, we'll do more exciting things.
Previous part: Introduction | Go in Plain Language