Go Part 1: Setup and Introduction
Please Subscribe Youtube| Like Facebook | Follow Twitter
Introduction
Welcome to Go beginner tutorial series. In this article you will learn how to setup Go on your machine. Go is a modern programming language developed by Google that is designed to be simple, efficient, and easy to use. If you’re new to Go and looking to set up your local development environment on Windows or Linux, this guide will help you get started.
Setting up Go on Windows:
- Visit the official Go website and download the latest version of Go for Windows.
- Run the installer and follow the instructions to install Go on your system. Make sure to select the option to add Go to your system PATH during installation.
- Verify that Go is installed correctly by opening a command prompt and typing “go version” without quotes. You should see the installed Go version number displayed.
Setting up Go on Linux:
- Go is not usually pre-installed on most Linux distributions. You can download and install Go using the official package manager for your distribution.
- Open a terminal and type “sudo apt-get update” without quotes to update the package list.
- Type “sudo apt-get install golang-go” without quotes to install Go.
- Verify that Go is installed correctly by typing “go version” without quotes. You should see the installed Go version number displayed.
Setting up Visual Studio Code for Go:
- Download and install Visual Studio Code from the official website.
- Launch Visual Studio Code and install the Go extension from the extensions marketplace by clicking on the extensions icon on the left-hand side of the editor and searching for “Go”.
- Create a new file by clicking on “File” and selecting “New File”.
- Type the following code into the editor:
package main
import "fmt"
func main() {
fmt.Println("Hello, World!")
}
- Save the file with a “.go” extension by clicking on “File” and selecting “Save As”. Choose a file name and save the file with the “.go” extension.
- Press F5 or go to “Run” and select “Run Without Debugging”. You should see “Hello, World
Go Beginner Tutorial Series
- Go Part 1: Setup and Introduction
- GO PART 2: UNDERSTANDING BASIC DATA TYPES AND VARIABLES IN GO
- Go PART 3: OPERATORS AND EXPRESSIONS IN Go
- GO PART 4: CONTROL FLOW STATEMENTS IN GO
- Go PART 5: Functions In Go
- GO PART 6: ARRAYS AND SLICES IN GO
- Go Part 7: String Manipulation In Go
- Go Part 8: Struct Type in Go
- Go Part 9: Pointers in Go
- Go Part 10: Error Handling in Go