HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to GoVariablesData TypesOperatorsStringsArray & SliceMap (Dictionary)Conditions (if / switch)Loops (for)Functions
REFERENCE
📖 Overview
🖥️ Output
📦 Variables
🔢 Numbers & Math
✍️ String
📋 Array & Slice
🗂️ Map
🔁 Condition & Loop
🧩 Function

Go lessons

Fast and simple

Go was designed in 2009 at Google by three experienced engineers starting from a very concrete complaint: compiling C++ in large projects took minutes, and the language was so complex that no one knew all of its features. Go does the exact opposite — it is intentionally a small language.

Go's language features can be read in an afternoon: there is no inheritance, no exceptions, no overloading. In return, compilation finishes almost instantly, it produces a single executable file, and concurrency is built right into the language. To run a job in parallel, you just type the go keyword.

This simplicity made Go the language of cloud infrastructure. Docker, Kubernetes, Terraform, and Prometheus — most of the core tools of modern system administration are written in Go. It is also one of the most preferred languages in microservice architectures.

📖 Command Reference→
  • •

    Introduction to Go

    First step into Go, a fast and simple language: the structure of every program (package/import/main) and printing with fmt.Println.

    →
  • •

    Variables

    The := short declaration, explicit type with var, const constants, and the "unused variable" rule.

    →
  • •

    Data Types

    int, float64, string, bool types; finding the type with %T and type conversion.

    →
  • •

    Operators

    Math (+ - * / %), comparison (== < >), and logic (&& || !). Use math.Pow for exponents.

    →
  • •

    Strings

    Length with len, case conversion, splitting, and joining with the strings package.

    →
  • •

    Array & Slice

    Flexible lists (slices), adding with append, and iterating with range.

    →
  • •

    Map (Dictionary)

    Creating key-value mappings, accessing them, and iterating with range.

    →
  • •

    Conditions (if / switch)

    Parenthesis-free if-else, else if, and multi-branch switch.

    →
  • •

    Loops (for)

    Go's only loop is for, with three forms: classic, conditional (like while), and range.

    →
  • •

    Functions

    Definition with func, parameter/return types, and multiple return values.

    →

What you will learn

  • Printing output and defining variables with the fmt package
  • Storing data with slices and maps
  • Returning multiple values from functions
  • Returning and checking errors as values
  • Combining data and behavior using structs and methods
  • Building loosely coupled designs with interfaces
  • Executing concurrent tasks with goroutines and channels

Who is this for?

  • Back-end developers who want to write microservices or API servers
  • Those working with DevOps and cloud infrastructure
  • Those who want to write fast-compiling tools that can be distributed as a single file

When to use?

Go is very efficient for network services, API servers, command-line tools, cloud infrastructure software, and systems that need to handle a large number of concurrent requests.

In large enterprise applications with complex business rules, the simplicity of the language sometimes leads to boilerplate code. It also lacks a mature ecosystem for desktop interfaces, mobile apps, and data science.

Frequently asked questions

Are Go and Golang the same thing?

Yes. The official name of the language is Go, while Golang is the nickname derived from the website's address that caught on because it makes searching easier. Both refer to the same language.

Why is there no try-catch in Go?

Go treats errors not as a hidden control flow, but as ordinary return values. A function returns both the result and the error, and you check it immediately. This makes you write more lines of code, but makes it obvious where errors occur while reading the code.

What is the difference between a goroutine and a thread?

A goroutine is much lighter: while an OS thread requires megabytes of stack space, a goroutine starts with kilobytes and grows as needed. This is why a Go program can run hundreds of thousands of goroutines; the same number of OS threads would be impossible.

Why are there no classes and inheritance in Go?

The designers believed that inheritance creates deep hierarchies and fragile dependencies. Go uses embedding and interfaces instead: if a type implements the methods of an interface, it satisfies that interface without explicitly declaring it. In practice, most object-oriented designs can be built this way.

Summary

With a simple language design, lightning-fast compilation, and built-in concurrency, Go is one of the preferred languages in the world of cloud and services. In this course, we start with fmt and progress all the way to interfaces and goroutine usage.

HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code