Learn Go
A comprehensive guide from installation to advanced patterns. Bilingual — hover or tap any paragraph to reveal Vietnamese translation.
What you'll learn
Simple & Fast
Compiles in seconds, runs at near-C speed with a tiny runtime
Concurrency Built-in
Goroutines and channels make concurrent code natural and safe
Static Typing
Strong type system with inference — safety without verbosity
Great Toolchain
go fmt, go test, go build — batteries included, no config needed
Getting Started
Install Go, set up modules, and write your first program
Cài đặt Go, thiết lập module và viết chương trình đầu tiên
Basic Concepts
Variables, constants, types, and zero values
Biến, hằng số, kiểu dữ liệu và giá trị mặc định
Control Flow
if/else, for loops, switch, and defer
if/else, vòng lặp for, switch và defer
Functions
Multiple returns, closures, variadic functions, and init
Đa giá trị trả về, closure, hàm variadic và init
Data Structures
Arrays, slices, maps, and structs
Mảng, slice, map và struct
Methods & Interfaces
Methods, interfaces, and type assertions
Phương thức, interface và type assertion
Error Handling
error type, wrapping, errors.Is/As, and panic/recover
Kiểu error, wrapping, errors.Is/As và panic/recover
Concurrency
Goroutines, channels, select, and sync primitives
Goroutine, channel, select và đồng bộ hóa
Packages & Modules
Package system, go.mod, and dependency management
Hệ thống gói, go.mod và quản lý dependency
Generics
Type parameters, constraints, and generic functions (Go 1.18+)
Tham số kiểu, ràng buộc và hàm generic (Go 1.18+)
Standard Library
fmt, os, net/http, encoding/json, context, and more
fmt, os, net/http, encoding/json, context và nhiều hơn nữa
Testing
Unit tests, table-driven tests, and benchmarks
Kiểm thử đơn vị, kiểm thử bảng và benchmark
Go Toolchain
go fmt, go vet, go test, and golangci-lint
go fmt, go vet, go test và golangci-lint
Idiomatic Go
Go proverbs, patterns, and best practices
Go proverbs, các pattern và thực tiễn tốt nhất