Go Tutorial

Welcome to Go Language (GoLang) Tutorial. In this tutorial, we learn what Go language is, its features, and list out the tutorials covering basics, conditional and looping statements, collections, etc.

“Go” and “Golang” are used interchangeably in this and subsequent tutorials.

What is Go Language?

Go is a programming language initially developed at Google in the year 2007 by Robert Griesemer, Rob Pike, and Ken Thompson.

Go language provides a rich standard library. The Go programming language is used in some of Google’s production systems and also in many other major companies.

Resemblance with other languages

Go is a statically-typed language having the syntax similar to that of C.

Go Features

Go language provides

  • Garbage Collection
  • Type Safety
  • Dynamic-typing capability

and many advanced built-in types such as variable length arrays and key-value maps.

Prerequisites to learn Go

Basic programming concepts would help you understand easily. This Go tutorial is targeted for beginners. So, even if you have just started programming with Go language, we will guide you through the basics of Go programming with well detailed tutorials.

Go Tutorials


Basics

  1. Run Go Program
  2. Go Comments
  3. Go Datatypes
  4. Go Variables
  5. Go Constants

Conditional Statements

  1. Go If statement
  2. Go If Else statement
  3. Go Switch statement

Looping Statements

  1. Go For Loop
  2. Go Break statement
  3. Go Continue statement
  4. Go Goto statement
  5. Go For Each

Operators

Logical Operators

  1. Go AND Operator
  2. Go OR Operator
  3. Go NOT Operator

Arithmetic Operators

  1. Go Addition Operator
  2. Go Subtraction Operator
  3. Go Multiplication Operator
  4. Go Division Operator
  5. Go Remainder Operator
  6. Go Increment Operator
  7. Go Decrement Operator

Functions

Functions are basic in any functional or modular programming language.

  1. Go Functions

String Operations

  1. Go – String Length
  2. Go – String Concatenation
  3. Go – Check if Strings are Equal
  4. Go – Compare Strings
  5. Go – Check if String contains Substring
  6. Go – Check if String starts with a Prefix
  7. Go – Check if String ends with a Suffix
  8. Go – Count occurrences of Substring in a String
  9. Go – Find Index of Last Occurrence of Substring in String
  10. Go – Get index of a substring in a String
  11. Go – Join/Concatenate String and Integer
  12. Go – Replace Substring in String
  13. Go – Split String
  14. Go – String to Uppercase
  15. Go – String to Lowercase
  16. Go – Trim spaces around String

Conversions

  1. Go – Convert String to Integer
  2. Go – Convert String to Float
  3. Go – Convert Int to String
  4. Go – Convert String into Array of Characters

Arrays

Arrays are a kind of sequential data structures that allow to store multiple elements of a datatype under a single variable. You can access the elements using index.

  1. Go – Declare and Initialize Arrays
  2. Go – Array Length
  3. Go – Create String Array
  4. Go – Create Integer Array
  5. Go – Iterate over Array using For Loop
  6. Go – Check if Specific Element is present in Array

Slice

  1. Go Slice
  2. Go – Slice Length
  3. Go – Iterate over Slice using For Loop
  4. Go – Check if Specific Element is present in Slice
  5. Go – Sort Slice of Strings
  6. Go – Sort Slice of Integers

Structures

  1. Go Struct

Range

  1. Go Range
  2. Go – Iterate over Range using For Loop

Maps

  1. Go Map
  2. Go – Create Empty Map
  3. Go – Map Length
  4. Go – Iterate over Map
  5. Go – Update Key in Map
  6. Go – Nested Maps
  7. Go – Check if Key is present in Map

Conversions

  1. Go – Convert Map to JSON
  2. Go – Convert JSON to Map

Channels

  1. Go Channel

Classes

  1. Go Class

HTTP

  1. Go HTTP

Error Handling

  1. Go Error Handling

Math Functions

  1. Go – Absolute Value
  2. Go – Ceil Value
  3. Go – Floor Value
  4. Go – Round Value
  5. Go – Square Root
  6. Go – Cube Root