Installing Go: A step towards programming with this language

Jonas Maro
2 min readMar 5, 2023

--

Go is a modern and powerful programming language that has gained popularity in recent years due to its ability to create fast, scalable, and reliable applications. This language has been developed by Google and is used in many of its internal applications, which shows its great potential.

Before starting to program in Go, it is necessary to install it in our system. Go is compatible with most operating systems, including Windows, macOS, Linux, FreeBSD, and Solaris. Therefore, regardless of the operating system you are using, you will be able to install Go without any problems. To do this, we can follow the following steps:

Download and install Go

The first thing you need to do to install Go is to download it from the official website. To do this, go to the Go download page (https://golang.org/dl/) and choose the appropriate version for your operating system. Once you’ve downloaded it, follow the steps to install Go on your computer.

Setting environment variables

Once you have installed Go, you will have to configure the environment variables of the operating system in question. In case of being MacOS or Linux, you will have to edit the files .bashrc or .bash_profile and in the case of Windows, you must do it through the visual interface for environment variables that it offers.

export GOROOT=$HOME/go
export PATH=$PATH:$GOROOT/bin
export GOPATH=$HOME/go_projects

Installation of libraries

Libraries are software packages that contain useful functions for building applications. Go comes with a set of built-in libraries, but there are many others you can download to access more advanced features. These libraries can be installed from the Go website itself. Just click the “Install Library” button and follow the steps to install them.

Installation test

Once you’ve finished installing Go, you can check if everything worked correctly by running a test program. In any programming language, the first program that is usually written is the famous ”Hello world”. Next, we will see how to write this program in Go:

package main

import "fmt"

func main() {
fmt.Println("Hello world")
}

To execute it, we simply have to save it in a file with a .go extension, and then execute the following command in our terminal:

go run your_file_name.go

If everything went well, we will see the message “Hello world” on the screen.

Conclusion

Installing Go is a simple process that only takes a few minutes. If you follow these simple steps, you will be able to start programming without problems. If you haven’t tried Go yet, go for it! It is an excellent programming language for beginners and professionals. Little by little you will discover its tools, and before you know it you will be coding incredible applications.

This article was originally published on dblspace.com

--

--

Jonas Maro
Jonas Maro

Written by Jonas Maro

Developer and passionate about technology.

No responses yet