Go Tutorial #8: Interfaces and Polymorphism

In the previous tutorial, you learned about structs, methods, and composition. Now it is time to learn about interfaces — one of Go’s most powerful features. Interfaces in Go are different from most languages. There is no implements keyword. If a type has the right methods, it automatically satisfies the interface. This is called implicit implementation. What is an Interface? An interface defines a set of method signatures. Any type that implements all those methods satisfies the interface: ...

April 9, 2026 · 9 min

Go Tutorial #7: Structs, Methods, and Composition

In the previous tutorial, you learned about slices and maps. Now it is time to learn how to create your own types with structs. Go does not have classes. Instead, it uses structs and methods. Structs hold data, and methods add behavior. This is simpler than class-based languages like Java or Python. Defining a Struct A struct groups related fields together: package main import "fmt" type User struct { Name string Email string Age int } func main() { // Create a struct with field names user1 := User{ Name: "Alex", Email: "alex@example.com", Age: 25, } fmt.Println(user1) // Access fields with dot notation fmt.Println("Name:", user1.Name) fmt.Println("Email:", user1.Email) // Update a field user1.Age = 26 fmt.Println("New age:", user1.Age) } Output: ...

April 9, 2026 · 8 min

Go Tutorial #6: Arrays, Slices, and Maps

In the previous tutorial, you learned about control flow with if, switch, and for. Now it is time to learn about Go’s most important data structures: arrays, slices, and maps. Slices and maps are the collections you will use every day in Go. Arrays exist too, but you will almost always use slices instead. Arrays An array in Go has a fixed size. You set the size when you declare it, and it cannot change: ...

April 9, 2026 · 9 min

Go Tutorial #5: Control Flow — if, switch, for

In the previous tutorial, you learned about functions and error handling. Now it is time to learn how to control the flow of your program with if, switch, and for. Go keeps control flow simple. There is only one loop keyword: for. No while, no do-while. Just for. The switch statement is also simpler and more powerful than in most languages. if / else The basic if statement works like most languages. But Go does not need parentheses around the condition: ...

April 9, 2026 · 10 min

Go Tutorial #4: Functions and Error Handling

In the previous tutorial, you learned about variables, types, and constants. Now it is time to learn about functions. Functions are the building blocks of every Go program. Go functions have a unique feature: they can return multiple values. This is the foundation of Go’s error handling pattern. Basic Functions A function in Go starts with the func keyword: package main import "fmt" // A function that takes two ints and returns their sum func add(a int, b int) int { return a + b } // When parameters have the same type, you can shorten it func multiply(a, b int) int { return a * b } // A function with no return value func greet(name string) { fmt.Printf("Hello, %s!\n", name) } func main() { result := add(3, 4) fmt.Println("3 + 4 =", result) product := multiply(5, 6) fmt.Println("5 * 6 =", product) greet("Alex") } Output: ...

April 8, 2026 · 10 min

Go Tutorial #3: Variables, Types, and Constants

In the previous tutorial, you installed Go, set up VS Code, and wrote your first program. Now it is time to learn about variables, types, and constants. These are the building blocks of every Go program. Declaring Variables Go has two ways to declare variables: the var keyword and the short declaration :=. The var Keyword The var keyword declares a variable with an explicit type: package main import "fmt" func main() { var name string = "Alex" var age int = 25 var height float64 = 1.75 var isStudent bool = true fmt.Println(name, age, height, isStudent) } Output: ...

April 8, 2026 · 10 min

Go Tutorial #2: Installing Go and Your First Program

In the previous tutorial, you learned what Go is and why it is a great language to learn. Now it is time to install Go and write your first program. This tutorial covers installation on all three major platforms. You will also set up VS Code and learn the basic Go commands. Try Go Online First Before installing anything, you can try Go in your browser. The Go Playground lets you write and run Go code online: ...

April 8, 2026 · 8 min

Go Tutorial #1: What is Go? Why Learn It in 2026?

Go is a programming language created by Google. It is simple, fast, and built for modern software. If you want to build web servers, CLI tools, or cloud infrastructure, Go is one of the best choices in 2026. In this tutorial, you will learn what Go is, where it is used, and why so many companies choose it. You will also see how Go compares to other popular languages. What is Go? Go (also called Golang) is an open-source programming language. Google created it in 2009. Robert Griesemer, Rob Pike, and Ken Thompson designed it. These are some of the most experienced engineers in the history of computing. ...

April 8, 2026 · 7 min