Go Part 1: Setup and Introduction

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:

  1. Visit the official Go website and download the latest version of Go for Windows.
  2. 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.
  3. 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:

  1. Go is not usually pre-installed on most Linux distributions. You can download and install Go using the official package manager for your distribution.
  2. Open a terminal and type “sudo apt-get update” without quotes to update the package list.
  3. Type “sudo apt-get install golang-go” without quotes to install Go.
  4. 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

Please Subscribe Youtube| Like Facebook | Follow Twitter


Leave a Reply

Your email address will not be published. Required fields are marked *