| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| golang [2026/01/11 22:29] – [6) Standard Library Essentials] phong2018 | golang [2026/02/23 00:00] (current) – removed phong2018 |
|---|
| ==== 1) Setup & Tooling ==== | |
| * [[go:tooling:start|Setup & Tooling]] | |
| * [[go:tooling:install|Install Go]] | |
| * [[go:tooling:versions|Go versions]] | |
| * [[go:tooling:goroot_gopath|GOROOT & GOPATH]] | |
| * [[go:tooling:go_command|go command]] | |
| * [[go:tooling:go_run|go run]] | |
| * [[go:tooling:go_build|go build]] | |
| * [[go:tooling:go_test|go test]] | |
| * [[go:tooling:go_get|go get]] | |
| * [[go:tooling:go_mod|go mod (overview)]] | |
| * [[go:tooling:go_env|go env]] | |
| * [[go:tooling:go_generate|go generate]] | |
| * [[go:tooling:go_work|go work (workspace)]] | |
| * [[go:tooling:format_lint|Format & Lint]] | |
| * [[go:tooling:gofmt|gofmt]] | |
| * [[go:tooling:goimports|goimports]] | |
| * [[go:tooling:govet|go vet]] | |
| * [[go:tooling:staticcheck|staticcheck]] | |
| * [[go:tooling:linting_rules|Lint rules]] | |
| * [[go:tooling:ide|IDE & Editor]] | |
| * [[go:tooling:gopls|gopls (Go language server)]] | |
| * [[go:tooling:debugging|Debugging]] | |
| * [[go:tooling:delve|Delve (dlv)]] | |
| * [[go:tooling:build_tags|Build tags]] | |
| * [[go:tooling:ci|CI basics]] | |
| |
| ---- | |
| |
| ==== 2) Language Basics ==== | |
| * [[go:basics:start|Basics]] | |
| * [[go:basics:package_import|Package & import]] | |
| * [[go:basics:main_package|package main]] | |
| * [[go:basics:init_func|init()]] | |
| * [[go:basics:visibility|Exported vs unexported]] | |
| * [[go:basics:variables|Variables]] | |
| * [[go:basics:var_const|var & const]] | |
| * [[go:basics:short_decl|:= (short declaration)]] | |
| * [[go:basics:zero_value|Zero value]] | |
| * [[go:basics:type_inference|Type inference]] | |
| * [[go:basics:types|Types]] | |
| * [[go:basics:basic_types|Basic types (int, string, bool...)]] | |
| * [[go:basics:type_conversion|Type conversion]] | |
| * [[go:basics:type_alias|Type alias vs defined type]] | |
| * [[go:basics:operators|Operators]] | |
| * [[go:basics:control_flow|Control flow]] | |
| * [[go:basics:if|if]] | |
| * [[go:basics:switch|switch]] | |
| * [[go:basics:for|for]] | |
| * [[go:basics:range|range]] | |
| * [[go:basics:defer|defer]] | |
| * [[go:basics:functions|Functions]] | |
| * [[go:basics:params_returns|Parameters & returns]] | |
| * [[go:basics:multiple_returns|Multiple return values]] | |
| * [[go:basics:named_returns|Named return values]] | |
| * [[go:basics:variadic|Variadic (...)]] | |
| * [[go:basics:closures|Closures]] | |
| * [[go:basics:panic_recover|panic & recover]] | |
| * [[go:basics:pointers|Pointers]] | |
| * [[go:basics:address_deref|& and *]] | |
| * [[go:basics:nil|nil]] | |
| * [[go:basics:strings_bytes|String & []byte]] | |
| * [[go:basics:runes|rune & UTF-8]] | |
| * [[go:basics:string_builder|strings.Builder]] | |
| |
| ---- | |
| |
| ==== 3) Data Structures ==== | |
| * [[go:data_structures:start|Data Structures]] | |
| * [[go:data_structures:array|Array]] | |
| * [[go:data_structures:slice|Slice]] | |
| * [[go:data_structures:append|append]] | |
| * [[go:data_structures:copy|copy]] | |
| * [[go:data_structures:slicing|Slicing expressions]] | |
| * [[go:data_structures:capacity|len & cap]] | |
| * [[go:data_structures:make_new|make vs new]] | |
| * [[go:data_structures:map|Map]] | |
| * [[go:data_structures:map_zero|Zero value & nil map]] | |
| * [[go:data_structures:map_iteration|Iteration order]] | |
| * [[go:data_structures:struct|Struct]] | |
| * [[go:data_structures:methods|Methods]] | |
| * [[go:data_structures:embedding|Embedding]] | |
| * [[go:data_structures:tags|Struct tags (json, db...)]] | |
| * [[go:data_structures:interface|Interface]] | |
| * [[go:data_structures:implicit_impl|Implicit implementation]] | |
| * [[go:data_structures:empty_interface|any / interface{}]] | |
| * [[go:data_structures:type_assertion|Type assertion]] | |
| * [[go:data_structures:type_switch|Type switch]] | |
| * [[go:data_structures:nil_interface|nil pitfalls]] | |
| * [[go:data_structures:generics|Generics]] | |
| * [[go:data_structures:type_params|Type parameters]] | |
| * [[go:data_structures:constraints|Constraints]] | |
| * [[go:data_structures:generic_collections|Generic collections]] | |
| |
| ---- | |
| |
| ==== 4) Error Handling ==== | |
| * [[go:errors:start|Error Handling]] | |
| * [[go:errors:error_type|error interface]] | |
| * [[go:errors:custom_error|Custom errors]] | |
| * [[go:errors:sentinel|Sentinel errors]] | |
| * [[go:errors:wrapping|Error wrapping (%w)]] | |
| * [[go:errors:errors_is_as|errors.Is / errors.As]] | |
| * [[go:errors:panic_vs_error|panic vs error]] | |
| * [[go:errors:defer_cleanup|defer for cleanup]] | |
| |
| ---- | |
| |
| ==== 5) Concurrency ==== | |
| * [[go:concurrency:start|Concurrency]] | |
| * [[go:concurrency:goroutine|Goroutine]] | |
| * [[go:concurrency:channel|Channel]] | |
| * [[go:concurrency:buffered|Buffered vs unbuffered]] | |
| * [[go:concurrency:close|close(channel)]] | |
| * [[go:concurrency:range_channel|range over channel]] | |
| * [[go:concurrency:directional|Directional channels]] | |
| * [[go:concurrency:select|select]] | |
| * [[go:concurrency:context|context.Context]] | |
| * [[go:concurrency:cancel|WithCancel]] | |
| * [[go:concurrency:timeout|WithTimeout]] | |
| * [[go:concurrency:deadline|WithDeadline]] | |
| * [[go:concurrency:values|WithValue]] | |
| * [[go:concurrency:sync|sync package]] | |
| * [[go:concurrency:mutex|Mutex]] | |
| * [[go:concurrency:rwmutex|RWMutex]] | |
| * [[go:concurrency:waitgroup|WaitGroup]] | |
| * [[go:concurrency:once|Once]] | |
| * [[go:concurrency:cond|Cond]] | |
| * [[go:concurrency:atomic|atomic]] | |
| * [[go:concurrency:race|Race condition]] | |
| * [[go:concurrency:race_detector|Race detector (-race)]] | |
| * [[go:concurrency:worker_pool|Worker pool pattern]] | |
| * [[go:concurrency:errgroup|errgroup]] | |
| |
| ---- | |
| |
| ==== 6) Standard Library Essentials ==== | |
| * [[go:stdlib:start|Standard Library]] | |
| * [[go:stdlib:fmt|fmt]] | |
| * [[go:stdlib:time|time]] | |
| * [[go:stdlib:strings|strings]] | |
| * [[go:stdlib:bytes|bytes]] | |
| * [[go:stdlib:math|math]] | |
| * [[go:stdlib:encoding_json|encoding/json]] | |
| * [[go:stdlib:net_http|net/http]] | |
| * [[go:stdlib:http_client|HTTP client]] | |
| * [[go:stdlib:http_server|HTTP server]] | |
| * [[go:stdlib:middleware|Middleware]] | |
| * [[go:stdlib:TCP_vs_HTTP|TCP vs HTTP]] | |
| * [[go:stdlib:net_dial|net.Dial]] | |
| * [[go:stdlib:io|io]] | |
| * [[go:stdlib:Reading_Writing_patterns|Reading/Writing patterns]] | |
| * [[go:stdlib:bufio|bufio]] | |
| * [[go:stdlib:os|os]] | |
| * [[go:stdlib:os_open|os.Open]] | |
| * [[go:stdlib:context|context]] | |
| * [[go:stdlib:crypto|crypto/tls basics]] | |
| * [[go:stdlib:crypto_sha256|crypto/sha256]] | |
| * [[go:stdlib:database_sql|database/sql]] | |
| * [[go:stdlib:sql_drivers|Drivers]] | |
| * [[go:stdlib:transactions|Transactions]] | |
| * [[go:stdlib:prepared_statements|Prepared statements]] | |
| |
| ---- | |
| |
| ==== 7) Testing ==== | |
| * [[go:testing:start|Testing]] | |
| * [[go:testing:unit_test|Unit test (testing package)]] | |
| * [[go:testing:table_driven|Table-driven tests]] | |
| * [[go:testing:mocks|Mocking]] | |
| * [[go:testing:interfaces_for_mock|Interfaces for mocks]] | |
| * [[go:testing:benchmark|Benchmark]] | |
| * [[go:testing:fuzz|Fuzzing]] | |
| * [[go:testing:coverage|Coverage]] | |
| * [[go:testing:httptest|httptest]] | |
| |
| ---- | |
| |
| ==== 8) Web & API Development ==== | |
| * [[go:web:start|Web & API]] | |
| * [[go:web:rest|REST API]] | |
| * [[go:web:routing|Routing]] | |
| * [[go:web:validation|Validation]] | |
| * [[go:web:auth|Authentication]] | |
| * [[go:web:jwt|JWT]] | |
| * [[go:web:grpc|gRPC]] | |
| * [[go:web:protobuf|Protocol Buffers]] | |
| * [[go:web:interceptors|Interceptors]] | |
| * [[go:web:serialization|Serialization]] | |
| * [[go:web:json|JSON]] | |
| * [[go:web:openapi|OpenAPI/Swagger]] | |
| * [[go:web:rate_limit|Rate limiting]] | |
| * [[go:web:logging|Request logging]] | |
| |
| ---- | |
| |
| ==== 9) Data & Persistence ==== | |
| * [[go:data:start|Data & Persistence]] | |
| * [[go:data:sql|SQL]] | |
| * [[go:data:migrations|Migrations]] | |
| * [[go:data:connection_pool|Connection pool]] | |
| * [[go:data:orm|ORM]] | |
| * [[go:data:sqlc|sqlc]] | |
| * [[go:data:ent|ent]] | |
| * [[go:data:gorm|gorm]] | |
| * [[go:data:redis|Redis]] | |
| * [[go:data:cache|Caching strategies]] | |
| |
| ---- | |
| |
| ==== 10) Architecture & Project Structure ==== | |
| * [[go:architecture:start|Architecture]] | |
| * [[go:architecture:project_layout|Project layout]] | |
| * [[go:architecture:cmd|/cmd]] | |
| * [[go:architecture:internal|/internal]] | |
| * [[go:architecture:pkg|/pkg]] | |
| * [[go:architecture:dependency_injection|Dependency Injection]] | |
| * [[go:architecture:clean_arch|Clean Architecture]] | |
| * [[go:architecture:repository_pattern|Repository pattern]] | |
| * [[go:architecture:service_layer|Service layer]] | |
| * [[go:architecture:usecase|Usecase]] | |
| * [[go:architecture:ddd|DDD (Domain-Driven Design)]] | |
| * [[go:architecture:config|Configuration]] | |
| * [[go:architecture:env|env vars]] | |
| * [[go:architecture:viper|viper]] | |
| * [[go:architecture:logging|Logging]] | |
| * [[go:architecture:observability|Observability]] | |
| * [[go:architecture:metrics|Metrics]] | |
| * [[go:architecture:tracing|Tracing]] | |
| * [[go:architecture:profiling|Profiling (pprof)]] | |
| |
| ---- | |
| |
| ==== 11) Performance & Runtime ==== | |
| * [[go:performance:start|Performance]] | |
| * [[go:performance:profiling_pprof|pprof]] | |
| * [[go:performance:benchmarking|Benchmarking]] | |
| * [[go:performance:allocations|Allocations]] | |
| * [[go:performance:escape_analysis|Escape analysis]] | |
| * [[go:performance:gc|GC (Garbage Collector)]] | |
| * [[go:performance:memory_cpu|Memory & CPU tuning]] | |
| |
| ---- | |
| |
| ==== 12) Build, Deploy, DevOps ==== | |
| * [[go:devops:start|Build & Deploy]] | |
| * [[go:devops:cross_compile|Cross compile]] | |
| * [[go:devops:docker|Docker]] | |
| * [[go:devops:systemd|systemd service]] | |
| * [[go:devops:release|Release versioning]] | |
| * [[go:devops:config_secrets|Secrets management]] | |
| * [[go:devops:ci_cd|CI/CD pipelines]] | |
| |
| ---- | |
| |
| ==== Glossary (từ khó hay gặp) ==== | |
| * [[go:glossary:concurrency|concurrency]] /kənˈkɝːənsi/: đồng thời | |
| * [[go:glossary:dependency|dependency]] /dɪˈpendənsi/: phụ thuộc | |
| * [[go:glossary:tooling|tooling]] /ˈtuːlɪŋ/: bộ công cụ | |
| * [[go:glossary:workspace|workspace]] /ˈwɝːkˌspeɪs/: không gian làm việc | |
| * [[go:glossary:observability|observability]] /əbˌzɝːvəˈbɪləti/: khả năng quan sát hệ thống | |
| * [[go:glossary:profiling|profiling]] /ˈproʊfaɪlɪŋ/: đo & phân tích hiệu năng | |