refactor(golang): cleanup roadmap content (#8976)

* audit first 36 files

* audit next 25 files

* audit next 26 topics

* audit next 29 topics

* audit last 65 topics.
This commit is contained in:
Vedansh
2025-08-07 21:59:30 +05:30
committed by GitHub
parent 841bc996a6
commit bcf59df1db
181 changed files with 1236 additions and 186 deletions
@@ -1,3 +1,8 @@
# Advanced Topics
Advanced Go topics include memory management, escape analysis, reflection, unsafe operations, CGO, and performance optimization. These sophisticated features enable building high-performance systems and solving specialized problems requiring deep language knowledge. While not needed for typical development, mastering these topics helps leverage Go's full capabilities.
Advanced Go topics include memory management, escape analysis, reflection, unsafe operations, CGO, and performance optimization. These sophisticated features enable building high-performance systems and solving specialized problems requiring deep language knowledge. While not needed for typical development, mastering these topics helps leverage Go's full capabilities.
Visit the following resources to learn more:
- [@article@Advanced GoLang Concepts: Channels, Context, and Interfaces](https://medium.com/@wambuirebeka/advanced-golang-concepts-channels-context-and-interfaces-dc3b71cd0ed8)
- [@article@Advanced Golang - Mastering Backend](https://masteringbackend.com/hubs/backend-engineering/advanced-golang)
@@ -1,3 +1,8 @@
# Anonymous Functions
Functions declared without names, also called function literals or lambdas. Can be assigned to variables, passed as arguments, or executed immediately. Useful for short operations, callbacks, goroutines, and closures. Access enclosing scope variables. Common in event handlers and functional patterns.
Functions declared without names, also called function literals or lambdas. Can be assigned to variables, passed as arguments, or executed immediately. Useful for short operations, callbacks, goroutines, and closures. Access enclosing scope variables. Common in event handlers and functional patterns.
Visit the following resources to learn more:
- [@article@Anonymous Functions](https://golangdocs.com/anonymous-functions-in-golang)
- [@article@Understanding Anonymous Functions in Go: A Practical Guide](https://dev.to/abstractmusa/understanding-anonymous-functions-in-go-a-practical-guide-57hd)
@@ -1,3 +1,8 @@
# Array to Slice Conversion
Convert arrays to slices using expressions like `array[:]` or `array[start:end]`. Creates slice header pointing to array memory - no data copying. Modifications through slice affect original array. Efficient way to use arrays with slice-based APIs.
Convert arrays to slices using expressions like `array[:]` or `array[start:end]`. Creates slice header pointing to array memory - no data copying. Modifications through slice affect original array. Efficient way to use arrays with slice-based APIs.
Visit the following resources to learn more:
- [@article@Slice Arrays Correctly](https://labex.io/tutorials/go-how-to-slice-arrays-correctly-418936)
- [@article@Go - Create Slice From Array - 3 Examples](https://www.tutorialkart.com/golang-tutorial/golang-create-slice-from-array/)
@@ -1,3 +1,8 @@
# Arrays
Fixed-size sequences of same-type elements. Size is part of the type, so different sizes are different types. Declared with specific length, initialized to zero values. Value types (copied when assigned/passed). Slices are more commonly used due to flexibility. Foundation for understanding Go's type system.
Fixed-size sequences of same-type elements. Size is part of the type, so different sizes are different types. Declared with specific length, initialized to zero values. Value types (copied when assigned/passed). Slices are more commonly used due to flexibility. Foundation for understanding Go's type system.
Visit the following resources to learn more:
- [@official@Arrays](https://go.dev/tour/moretypes/6)
- [@article@A Complete Guide to Arrays in Golang](https://www.kelche.co/blog/go/golang-arrays/)
@@ -1,3 +1,10 @@
# beego
Beego is a full-stack web framework providing MVC architecture, ORM, session management, caching, and admin interface generation. Follows convention over configuration with extensive tooling for rapid development of enterprise applications requiring comprehensive features.
Beego is a full-stack web framework providing MVC architecture, ORM, session management, caching, and admin interface generation. Follows convention over configuration with extensive tooling for rapid development of enterprise applications requiring comprehensive features.
Visit the following resources to learn more:
- [@official@Arrays](https://go.dev/tour/moretypes/6)
- [@opensource@beego/beego](https://github.com/beego/beego)
- [@article@Exploring Golang and Beego: A Beginner's Guide with Examples](https://medium.com/@vijeshomen/exploring-golang-and-beego-a-beginners-guide-with-examples-part-1-79619f0db1ac)
- [@official@beego package](https://pkg.go.dev/github.com/beego/beego)
@@ -1,3 +1,9 @@
# Benchmarks
Benchmarks measure code performance by timing repeated executions. Functions start with `Benchmark` and use `*testing.B` parameter. Run with `go test -bench=.` to identify bottlenecks, compare implementations, and track performance changes over time.
Benchmarks measure code performance by timing repeated executions. Functions start with `Benchmark` and use `*testing.B` parameter. Run with `go test -bench=.` to identify bottlenecks, compare implementations, and track performance changes over time.
Visit the following resources to learn more:
- [@official@Add a Test](https://go.dev/doc/tutorial/add-a-test)
- [@article@Benchmarking in Go: A Comprehensive Handbook](https://betterstack.com/community/guides/scaling-go/golang-benchmarking/)
- [@article@Benchmarking in Golang: Improving Function Performance](https://blog.logrocket.com/benchmarking-golang-improve-function-performance/)
@@ -1,3 +1,8 @@
# Boolean
The `bool` type represents `true` or `false` values with default zero value of `false`. Essential for conditional logic, control flow, and binary states. Results from comparison (`==`, `!=`) and logical operations (`&&`, `||`, `!`).
The `bool` type represents `true` or `false` values with default zero value of `false`. Essential for conditional logic, control flow, and binary states. Results from comparison (`==`, `!=`) and logical operations (`&&`, `||`, `!`).
Visit the following resources to learn more:
- [@official@Booleans in Golang](https://golangdocs.com/booleans-in-golang)
- [@article@Understanding Boolean Logic in Go](https://www.digitalocean.com/community/tutorials/understanding-boolean-logic-in-go)
@@ -1,3 +1,8 @@
# break
Immediately exits innermost loop or switch statement. In nested loops, only exits immediate loop unless used with labels to break outer loops. Essential for early termination when conditions are met. Helps write efficient loops that don't continue unnecessarily.
Immediately exits innermost loop or switch statement. In nested loops, only exits immediate loop unless used with labels to break outer loops. Essential for early termination when conditions are met. Helps write efficient loops that don't continue unnecessarily.
Visit the following resources to learn more:
- [@article@Using Break and Continue Statements When Working with Loop](https://www.digitalocean.com/community/tutorials/using-break-and-continue-statements-when-working-with-loops-in-go)
- [@article@Demystifying the Break and Continue Statements in Golang](https://medium.com/@kiruu1238/break-continue-bc35e9f3802d)
@@ -1,3 +1,9 @@
# bubbletea
Bubble Tea is a framework for building terminal UIs based on The Elm Architecture. Uses model-update-view pattern for interactive CLI applications with keyboard input, styling, and component composition. Excellent for sophisticated terminal tools and dashboards.
Bubble Tea is a framework for building terminal UIs based on The Elm Architecture. Uses model-update-view pattern for interactive CLI applications with keyboard input, styling, and component composition. Excellent for sophisticated terminal tools and dashboards.
Visit the following resources to learn more:
- [@opensource@charmbracelet/bubbletea](https://github.com/charmbracelet/bubbletea)
- [@article@Building UI of Golang CLI app with Bubble Tea](https://medium.com/@originalrad50/building-ui-of-golang-cli-app-with-bubble-tea-68b61e25445e)
- [@article@Intro to Bubble Tea in Go](https://dev.to/andyhaskell/intro-to-bubble-tea-in-go-21lg)
@@ -1,3 +1,8 @@
# Buffered vs Unbuffered
Unbuffered channels provide synchronous communication - sender blocks until receiver ready. Buffered channels allow asynchronous communication up to capacity. Unbuffered for coordination/sequencing, buffered for performance/decoupling. Critical distinction for concurrent system design.
Unbuffered channels provide synchronous communication - sender blocks until receiver ready. Buffered channels allow asynchronous communication up to capacity. Unbuffered for coordination/sequencing, buffered for performance/decoupling. Critical distinction for concurrent system design.
Visit the following resources to learn more:
- [@article@Advanced Insights into Go Channels](https://medium.com/@aditimishra_541/advanced-insights-into-go-channels-unbuffered-and-buffered-channels-d76d705bcc24)
- [@article@Buffered vs Unbuffered Channels in Golang](https://dev.to/akshitzatakia/buffered-vs-unbuffered-channels-in-golang-a-developers-guide-to-concurrency-3m75)
@@ -1,3 +1,9 @@
# bufio
Provides buffered I/O operations wrapping io.Reader/Writer interfaces for better performance. Reduces system calls by reading/writing larger chunks. Includes Scanner for line reading, Reader for buffered reading, Writer for buffered writing. Essential for efficient large file/network operations.
Provides buffered I/O operations wrapping io.Reader/Writer interfaces for better performance. Reduces system calls by reading/writing larger chunks. Includes Scanner for line reading, Reader for buffered reading, Writer for buffered writing. Essential for efficient large file/network operations.
Visit the following resources to learn more:
- [@official@Bufio](https://go.dev/src/bufio/bufio.go)
- [@official@Bufio Package](https://pkg.go.dev/bufio)
- [@article@Go Fast with bufio: Unlocking the Power of Buffered I/O](https://medium.com/@emusbeny/mastering-bufio-in-go-the-art-of-buffered-i-o-17cae584ee4b)
@@ -1,3 +1,9 @@
# Build Constraints & Tags
Special comments controlling which files are included when building. Use `//go:build` directive for platform-specific code, environment builds, or feature toggles. Common for different OS/architectures or debug vs production builds. Essential for portable Go applications.
Special comments controlling which files are included when building. Use `//go:build` directive for platform-specific code, environment builds, or feature toggles. Common for different OS/architectures or debug vs production builds. Essential for portable Go applications.
Visit the following resources to learn more:
- [@official@Build Package](https://pkg.go.dev/go/build)
- [@article@Advanced Go Build Techniques](https://dev.to/jacktt/go-build-in-advance-4o8n)
- [@article@Customizing Go Binaries with Build Tags](https://www.digitalocean.com/community/tutorials/customizing-go-binaries-with-build-tags)
@@ -1,3 +1,9 @@
# Build Tags
Build tags control file inclusion using `//go:build` directives based on conditions like OS, architecture, or custom tags. Enable conditional compilation for platform-specific code, feature flags, and environment-specific builds without runtime overhead.
Build tags control file inclusion using `//go:build` directives based on conditions like OS, architecture, or custom tags. Enable conditional compilation for platform-specific code, feature flags, and environment-specific builds without runtime overhead.
Visit the following resources to learn more:
- [@official@Build Package](https://pkg.go.dev/go/build)
- [@article@Advanced Go Build Techniques](https://dev.to/jacktt/go-build-in-advance-4o8n)
- [@article@Customizing Go Binaries with Build Tags](https://www.digitalocean.com/community/tutorials/customizing-go-binaries-with-build-tags)
@@ -1,3 +1,9 @@
# Building CLIs
Go excels at CLI development due to fast compilation, single binary distribution, and rich ecosystem. Use standard `flag` package or frameworks like Cobra, urfave/cli, Bubble Tea. Cross-compilation support for multiple platforms. Great for learning Go while building useful tools.
Go excels at CLI development due to fast compilation, single binary distribution, and rich ecosystem. Use standard `flag` package or frameworks like Cobra, urfave/cli, Bubble Tea. Cross-compilation support for multiple platforms. Great for learning Go while building useful tools.
Visit the following resources to learn more:
- [@official@Command-line Interfaces (CLIs)](https://go.dev/solutions/clis)
- [@article@Building a Command Line Interface (CLI) tool in Golang](https://medium.com/@mgm06bm/building-a-command-line-interface-cli-tool-in-golang-a-step-by-step-guide-44a7aad488e4)
- [@article@Building a feature rich Command Line Interface (CLI) in GO](https://blog.stackademic.com/building-a-feature-rich-command-line-interface-cli-in-go-42a127b090c8)
@@ -1,3 +1,11 @@
# Building Executables
The `go build` command compiles source code into standalone native executables with static linking. Creates self-contained binaries including all dependencies, requiring no Go installation on target systems. Control builds with various optimization flags.
The `go build` command compiles source code into standalone native executables with static linking. Creates self-contained binaries including all dependencies, requiring no Go installation on target systems. Control builds with various optimization flags.
Visit the following resources to learn more:
- [@official@Build Package](https://pkg.go.dev/go/build)
- [@official@Compile and Install Application](https://go.dev/doc/tutorial/compile-install)
- [@article@Advanced Go Build Techniques](https://dev.to/jacktt/go-build-in-advance-4o8n)
- [@article@Customizing Go Binaries with Build Tags](https://www.digitalocean.com/community/tutorials/customizing-go-binaries-with-build-tags)
- [@article@How To Build and Install Go Programs](https://www.digitalocean.com/community/tutorials/how-to-build-and-install-go-programs)
@@ -1,3 +1,11 @@
# Call by Value
Go creates copies of values when passing to functions, not references to originals. Applies to all types including structs and arrays. Provides safety but can be expensive for large data. Use pointers, slices, maps for references. Critical for performance optimization.
Go creates copies of values when passing to functions, not references to originals. Applies to all types including structs and arrays. Provides safety but can be expensive for large data. Use pointers, slices, maps for references. Critical for performance optimization.
Visit the following resources to learn more:
- [@official@Build Package](https://pkg.go.dev/go/build)
- [@official@Compile and Install Application](https://go.dev/doc/tutorial/compile-install)
- [@article@Advanced Go Build Techniques](https://dev.to/jacktt/go-build-in-advance-4o8n)
- [@article@Customizing Go Binaries with Build Tags](https://www.digitalocean.com/community/tutorials/customizing-go-binaries-with-build-tags)
- [@article@How To Build and Install Go Programs](https://www.digitalocean.com/community/tutorials/how-to-build-and-install-go-programs)
@@ -1,3 +1,9 @@
# Capacity and Growth
Slice capacity determines when reallocation occurs during append operations. Go typically doubles capacity for smaller slices. Pre-allocate with `make([]T, length, capacity)` to optimize memory usage and minimize allocations in performance-critical code.
Slice capacity determines when reallocation occurs during append operations. Go typically doubles capacity for smaller slices. Pre-allocate with `make([]T, length, capacity)` to optimize memory usage and minimize allocations in performance-critical code.
Visit the following resources to learn more:
- [@article@Understanding Go's Slice Data Structure and Its Growth Pattern](https://medium.com/@arjun.devb25/understanding-gos-slice-data-structure-and-its-growth-pattern-48fe6dd914b4)
- [@article@How to Increase Slice Capacity in Go](https://thekoreanguy.medium.com/how-does-the-capacity-change-when-you-append-to-a-slice-in-go-46289dad4730)
- [@article@How to Manage Slice Length and Capacity](https://labex.io/tutorials/go-how-to-manage-slice-length-and-capacity-418932)
@@ -1,3 +1,9 @@
# Centrifugo
Centrifugo is a real-time messaging server providing WebSocket services for Go applications. It offers channels, presence info, message history, and Redis scalability. Supports WebSocket, Server-Sent Events, and HTTP streaming while handling complex real-time patterns.
Centrifugo is a real-time messaging server providing WebSocket services for Go applications. It offers channels, presence info, message history, and Redis scalability. Supports WebSocket, Server-Sent Events, and HTTP streaming while handling complex real-time patterns.
Visit the following resources to learn more:
- [@official@Centrifugo](https://centrifugal.dev/)
- [@official@Getting Started with Centrifugo](https://centrifugal.dev/docs/getting-started/introduction)
- [@opensource@centrifugal/centrifuge](https://github.com/centrifugal/centrifuge)
@@ -1,3 +1,9 @@
# CGO Basics
CGO allows Go programs to call C code and vice versa using special comments. Enables C library integration but disables cross-compilation, reduces performance, and complicates deployment. Useful for legacy integration but pure Go is preferred.
CGO allows Go programs to call C code and vice versa using special comments. Enables C library integration but disables cross-compilation, reduces performance, and complicates deployment. Useful for legacy integration but pure Go is preferred.
Visit the following resources to learn more:
- [@official@CGO](https://go.dev/wiki/cgo)
- [@article@Understand How to use C libraries in Go with CGO](https://dev.to/metal3d/understand-how-to-use-c-libraries-in-go-with-cgo-3dbn)
- [@article@Calling C Functions from Go: A Quick Guide](https://www.codingexplorations.com/blog/calling-c-functions-from-go-a-quick-guide)
@@ -1,3 +1,9 @@
# Channels
Primary mechanism for goroutine communication following "share memory by communicating" principle. Typed conduits created with `make()`. Come in buffered and unbuffered varieties. Used for synchronization, data passing, and coordinating concurrent operations. Essential for concurrent programming.
Primary mechanism for goroutine communication following "share memory by communicating" principle. Typed conduits created with `make()`. Come in buffered and unbuffered varieties. Used for synchronization, data passing, and coordinating concurrent operations. Essential for concurrent programming.
Visit the following resources to learn more:
- [@official@Channels in Golang](https://golangdocs.com/channels-in-golang)
- [@article@Concurrency in Go: Channels and WaitGroups](https://medium.com/goturkiye/concurrency-in-go-channels-and-waitgroups-25dd43064d1)
- [@article@Go Channels Explained: More than Just a Beginner's Guide](https://blog.devtrovert.com/p/go-channels-explained-more-than-just)
@@ -1,3 +1,8 @@
# Closures
Functions capturing variables from surrounding scope, accessible even after outer function returns. "Close over" external variables for specialized functions, callbacks, state maintenance. Useful for event handling, iterators, functional programming. Important for flexible, reusable code.
Functions capturing variables from surrounding scope, accessible even after outer function returns. "Close over" external variables for specialized functions, callbacks, state maintenance. Useful for event handling, iterators, functional programming. Important for flexible, reusable code.
Visit the following resources to learn more:
- [@official@Closures in Golang](https://go.dev/tour/moretypes/25)
- [@article@Understanding Closures in Go](https://code101.medium.com/understanding-closures-in-go-encapsulating-state-and-behaviour-558ac3617671)
@@ -1,3 +1,9 @@
# Cobra
Powerful library for modern CLI applications. Used by kubectl, Hugo, GitHub CLI. Provides nested subcommands, flags, intelligent suggestions, auto help generation, shell completion. Follows POSIX standards with clean API. Includes command generator for quick bootstrapping.
Powerful library for modern CLI applications. Used by kubectl, Hugo, GitHub CLI. Provides nested subcommands, flags, intelligent suggestions, auto help generation, shell completion. Follows POSIX standards with clean API. Includes command generator for quick bootstrapping.
Visit the following resources to learn more:
- [@official@Cobra](https://cobra.dev/)
- [@article@How To Use the Cobra Package in Go](https://www.digitalocean.com/community/tutorials/how-to-use-the-cobra-package-in-go)
- [@article@Getting Started with Cobra](https://dev.to/frasnym/getting-started-with-cobra-creating-multi-level-command-line-interfaces-in-golang-2j3k)
@@ -1,3 +1,9 @@
# Code Generation / Build Tags
Code generation with `go generate` automates boilerplate creation, while build tags enable conditional compilation for different platforms and environments. These tools help create flexible, maintainable applications with platform-specific implementations and feature flags without runtime overhead.
Code generation with `go generate` automates boilerplate creation, while build tags enable conditional compilation for different platforms and environments. These tools help create flexible, maintainable applications with platform-specific implementations and feature flags without runtime overhead.
Visit the following resources to learn more:
- [@official@Generate](https://go.dev/blog/generate)
- [@article@How to Use Go Generate](https://blog.carlana.net/post/2016-11-27-how-to-use-go-generate/)
- [@article@Introduction to go generate](https://hsleep.medium.com/introduction-to-go-generate-99a93f30dc35)
@@ -1,3 +1,9 @@
# Code Quality and Analysis
Go provides tools for maintaining code quality including static analyzers, style checkers, and security scanners. Built-in tools like `go vet` provide basic analysis, while ecosystem tools like staticcheck and golangci-lint offer advanced checking for bugs, style, and security issues.
Go provides tools for maintaining code quality including static analyzers, style checkers, and security scanners. Built-in tools like `go vet` provide basic analysis, while ecosystem tools like staticcheck and golangci-lint offer advanced checking for bugs, style, and security issues.
Visit the following resources to learn more:
- [@official@Go Vet](https://pkg.go.dev/cmd/vet)
- [@article@Golang Static Code Analysis & Go Clean Code Tool](https://www.sonarsource.com/knowledge/languages/go/)
- [@article@Improving Go Code Quality](https://medium.com/@kanishksinghpujari/improving-go-code-quality-refactoring-code-reviews-and-static-analysis-083ca108e41d)
@@ -1,3 +1,10 @@
# Comma-Ok Idiom
Pattern for safely testing map key existence or type assertion success using `value, ok := map[key]` or `value, ok := interface.(Type)`. Returns both value and boolean status, preventing panics and distinguishing zero values from missing keys.
Pattern for safely testing map key existence or type assertion success using `value, ok := map[key]` or `value, ok := interface.(Type)`. Returns both value and boolean status, preventing panics and distinguishing zero values from missing keys.
Visit the following resources to learn more:
- [@official@Comma Ok](https://go.dev/tour/basics/10)
- [@article@The Comma Ok Idiom ](https://dev.to/saurabh975/comma-ok-in-go-l4f)
- [@article@How the Comma Ok Idiom and Package System Work in Go](https://www.freecodecamp.org/news/how-the-comma-ok-idiom-and-package-system-work-in-go/)
- [@article@Statement Idioms in Go](https://medium.com/@nateogbonna/statement-idioms-in-go-writing-clean-idiomatic-go-code-6fe92e6e8ab4)
@@ -1,3 +1,8 @@
# Commands & Docs
Go provides built-in documentation tools including `go doc` for terminal documentation and `godoc` for web interface. Documentation uses special comments. `go help` provides command information. Essential for exploring standard library and writing well-documented code.
Go provides built-in documentation tools including `go doc` for terminal documentation and `godoc` for web interface. Documentation uses special comments. `go help` provides command information. Essential for exploring standard library and writing well-documented code.
Visit the following resources to learn more:
- [@official@Go Doc](https://go.dev/godoc)
- [@article@A Guide to Effective Go Documentation](https://nirdoshgautam.medium.com/a-guide-to-effective-go-documentation-952f346d073f)
@@ -1,3 +1,8 @@
# Common Usecases
Context package common uses: HTTP timeouts, database deadlines, goroutine cancellation coordination, and request-scoped values. Essential for web servers, microservices, circuit breakers, and building responsive APIs that handle cancellation gracefully.
Context package common uses: HTTP timeouts, database deadlines, goroutine cancellation coordination, and request-scoped values. Essential for web servers, microservices, circuit breakers, and building responsive APIs that handle cancellation gracefully.
Visit the following resources to learn more:
- [@official@Use Cases](https://go.dev/solutions/use-cases)
- [@article@The Versatility of Go: Ideal Use Cases for the Golang Programming](https://dev.to/adityabhuyan/the-versatility-of-go-ideal-use-cases-for-the-golang-programming-language-7co)
@@ -1,3 +1,9 @@
# Compiler & Linker Flags
Build flags control compilation and linking. Common flags include `-ldflags` for linker options, `-gcflags` for compiler settings, `-tags` for build tags, and `-race` for race detection. Help optimize builds, reduce binary size, and embed build information.
Build flags control compilation and linking. Common flags include `-ldflags` for linker options, `-gcflags` for compiler settings, `-tags` for build tags, and `-race` for race detection. Help optimize builds, reduce binary size, and embed build information.
Visit the following resources to learn more:
- [@official@Flag Package](https://pkg.go.dev/flag)
- [@article@Leveraging Compiler Optimization Flags](https://goperf.dev/01-common-patterns/comp-flags/o)
- [@article@Compiler Optimization Flags](https://diginode.in/go/compiler-optimization-flags/)
@@ -1,3 +1,9 @@
# Complex Numbers
Built-in support with `complex64` and `complex128` types. Create using `complex()` function or literals like `3+4i`. Provides `real()`, `imag()`, `abs()` functions. Useful for mathematical computations, signal processing, and scientific applications.
Built-in support with `complex64` and `complex128` types. Create using `complex()` function or literals like `3+4i`. Provides `real()`, `imag()`, `abs()` functions. Useful for mathematical computations, signal processing, and scientific applications.
Visit the following resources to learn more:
- [@official@Complex Numbers](https://go.dev/ref/spec)
- [@article@Complex Numbers in Golang](https://golangdocs.com/complex-numbers-in-golang)
- [@article@Complex Data Types in Golang](https://dev.to/diwakarkashyap/complex-data-types-in-golang-go-328l)
@@ -1,3 +1,9 @@
# Concurrency Patterns
Established design approaches for structuring concurrent programs using goroutines and channels. Key patterns: fan-in (merging inputs), fan-out (distributing work), pipelines (chaining operations), worker pools, pub-sub communication. Help build efficient, scalable apps while avoiding race conditions and deadlocks.
Established design approaches for structuring concurrent programs using goroutines and channels. Key patterns: fan-in (merging inputs), fan-out (distributing work), pipelines (chaining operations), worker pools, pub-sub communication. Help build efficient, scalable apps while avoiding race conditions and deadlocks.
Visit the following resources to learn more:
- [@official@Go Concurrency Patterns: Pipelines and Cancellation](https://go.dev/blog/pipelines)
- [@article@Go Concurrency Patterns: A Deep Dive](https://medium.com/@gopinathr143/go-concurrency-patterns-a-deep-dive-a2750f98a102)
- [@article@Mastering Concurrency in Go](https://dev.to/santoshanand/mastering-concurrency-in-go-a-comprehensive-guide-5chi)
@@ -1,3 +1,9 @@
# Conditionals
Control program flow based on conditions. `if` for basic logic, `if-else` for binary decisions, `switch` for multiple conditions. `if` supports optional initialization, no parentheses needed but braces required. `switch` supports expressions, type switches, fallthrough. Fundamental for business logic.
Control program flow based on conditions. `if` for basic logic, `if-else` for binary decisions, `switch` for multiple conditions. `if` supports optional initialization, no parentheses needed but braces required. `switch` supports expressions, type switches, fallthrough. Fundamental for business logic.
Visit the following resources to learn more:
- [@official@Flow Control](https://go.dev/tour/flowcontrol/6)
- [@article@How To Write Conditional Statements in Go](https://www.digitalocean.com/community/tutorials/how-to-write-conditional-statements-in-go)
- [@article@How to handle conditional logic in Go](https://labex.io/tutorials/go-how-to-handle-conditional-logic-in-go-418319)
@@ -1,3 +1,8 @@
# const and iota
Constants declared with `const` represent unchanging compile-time values. `iota` creates successive integer constants starting from zero, resetting per `const` block. Useful for enumerations, bit flags, and constant sequences without manual values.
Constants declared with `const` represent unchanging compile-time values. `iota` creates successive integer constants starting from zero, resetting per `const` block. Useful for enumerations, bit flags, and constant sequences without manual values.
Visit the following resources to learn more:
- [@official@Iota](https://go.dev/wiki/Iota)
- [@article@Constants](https://webreference.com/go/basics/constants/)
@@ -1,3 +1,8 @@
# `context` Package
# context package
Carries deadlines, cancellation signals, and request-scoped values across API boundaries. Essential for robust concurrent applications, especially web services. Enables cancelling long-running operations, setting timeouts, passing request data. Typically first parameter passed down call stack.
Carries deadlines, cancellation signals, and request-scoped values across API boundaries. Essential for robust concurrent applications, especially web services. Enables cancelling long-running operations, setting timeouts, passing request data. Typically first parameter passed down call stack.
Visit the following resources to learn more:
- [@official@Go Concurrency Patterns: Context](https://go.dev/blog/context)
- [@article@The Complete Guide to Context in Golang](https://medium.com/@jamal.kaksouri/the-complete-guide-to-context-in-golang-efficient-concurrency-management-43d722f6eaea)
@@ -1,3 +1,8 @@
# continue
Skips rest of current iteration and jumps to next loop iteration. Only affects innermost loop unless used with labels. Useful for filtering elements, handling special cases early, avoiding nested conditionals. Makes loops cleaner and more efficient.
Skips rest of current iteration and jumps to next loop iteration. Only affects innermost loop unless used with labels. Useful for filtering elements, handling special cases early, avoiding nested conditionals. Makes loops cleaner and more efficient.
Visit the following resources to learn more:
- [@article@Using Break and Continue Statements When Working with Loop](https://www.digitalocean.com/community/tutorials/using-break-and-continue-statements-when-working-with-loops-in-go)
- [@article@Demystifying the Break and Continue Statements in Golang](https://medium.com/@kiruu1238/break-continue-bc35e9f3802d)
@@ -1,3 +1,8 @@
# Coverage
Test coverage measures code execution during testing using `go test -cover` and `-coverprofile`. Visualize with `go tool cover -html` to identify untested code paths. Helps maintain quality standards and guide testing efforts for more reliable applications.
Test coverage measures code execution during testing using `go test -cover` and `-coverprofile`. Visualize with `go tool cover -html` to identify untested code paths. Helps maintain quality standards and guide testing efforts for more reliable applications.
Visit the following resources to learn more:
- [@official@Coverage Profiling](https://go.dev/doc/build-cover)
- [@article@Understanding Go Coverage: A Guide to Test Coverage in Go](https://medium.com/@keployio/understanding-go-coverage-a-guide-to-test-coverage-in-go-0c6e5ac8ba81)
@@ -1,3 +1,8 @@
# Cross-compilation
Build executables for different OS and architectures using `GOOS` and `GOARCH` environment variables. Example: `GOOS=linux GOARCH=amd64 go build` creates Linux binaries. Enables multi-platform development without separate build environments.
Build executables for different OS and architectures using `GOOS` and `GOARCH` environment variables. Example: `GOOS=linux GOARCH=amd64 go build` creates Linux binaries. Enables multi-platform development without separate build environments.
Visit the following resources to learn more:
- [@official@GccgoCrossCompilation](https://go.dev/wiki/GccgoCrossCompilation)
- [@article@Cross-compiling made easy with Golang](https://medium.com/@keployio/understanding-go-coverage-a-guide-to-test-coverage-in-go-0c6e5ac8ba81)
@@ -1,3 +1,9 @@
# Data Types
Rich set of built-in types: integers (int8-64), unsigned integers (uint8-64), floats (float32/64), complex numbers, booleans, strings, runes. Statically typed - types determined at compile time for early error detection and performance. Crucial for efficient, reliable programs.
Rich set of built-in types: integers (int8-64), unsigned integers (uint8-64), floats (float32/64), complex numbers, booleans, strings, runes. Statically typed - types determined at compile time for early error detection and performance. Crucial for efficient, reliable programs.
Visit the following resources to learn more:
- [@official@Go Basics](https://go.dev/tour/basics/11)
- [@article@Basic Data Types in Go](https://golangbot.com/types/)
- [@article@Understanding Data Types in Go](https://www.digitalocean.com/community/tutorials/understanding-data-types-in-go)
@@ -1,3 +1,10 @@
# Deadlines & Cancellations
Context package mechanisms for controlling operation lifetime and propagating cancellation signals. Supports deadlines (absolute time) or timeouts (duration). Functions should check `ctx.Done()` and return early when cancelled. Essential for robust concurrent applications.
Context package mechanisms for controlling operation lifetime and propagating cancellation signals. Supports deadlines (absolute time) or timeouts (duration). Functions should check `ctx.Done()` and return early when cancelled. Essential for robust concurrent applications.
Visit the following resources to learn more:
- [@official@Canceling in-progress Operations](https://go.dev/doc/database/cancel-operations)
- [@article@Understanding Golang Context: Cancellation, Timeouts](https://webdevstation.com/posts/understanding-golang-context/)
- [@article@Understanding Context in Golang](https://medium.com/better-programming/understanding-context-in-golang-7f574d9d94e0)
- [@article@How to use the context.Done\(\) method in Go](https://dev.to/mcaci/how-to-use-the-context-done-method-in-go-22me)
@@ -1,3 +1,8 @@
# Deployment & Tooling
Go deployment focuses on building optimized binaries for production. Static compilation creates self-contained executables, while cross-compilation builds for multiple platforms. Key aspects include containerization, configuration management, monitoring, and binary optimization for efficient production deployments.
Go deployment focuses on building optimized binaries for production. Static compilation creates self-contained executables, while cross-compilation builds for multiple platforms. Key aspects include containerization, configuration management, monitoring, and binary optimization for efficient production deployments.
Visit the following resources to learn more:
- [@article@An overview of Go's tooling](https://www.alexedwards.net/blog/an-overview-of-go-tooling)
- [@article@Deploying Go Applications](https://medium.com/@teja.ravi474/deploying-go-applications-63219d187795)
@@ -1,3 +1,9 @@
# echo
High-performance, minimalist web framework focusing on ease and speed. Provides routing, middleware, data binding, validation, rendering. Features automatic TLS, HTTP/2, WebSocket support. Built-in middleware for CORS, JWT, logging, compression. Popular for RESTful APIs and microservices.
High-performance, minimalist web framework focusing on ease and speed. Provides routing, middleware, data binding, validation, rendering. Features automatic TLS, HTTP/2, WebSocket support. Built-in middleware for CORS, JWT, logging, compression. Popular for RESTful APIs and microservices.
Visit the following resources to learn more:
- [@official@High Performance, Extensible, Minimalist Go Web framework](https://echo.labstack.com/)
- [@official@Echo Documentation](https://echo.labstack.com/docs)
- [@article@Best Practices for Structuring Scalable Golang APIs with Echo](https://medium.com/@OTS415/structuring-golang-echo-apis-8d657de5dc7c)
@@ -1,3 +1,8 @@
# Embedding Interfaces
Create new interfaces by combining existing ones, promoting composition and reusability. Embedded interface methods automatically included. Enables interface hierarchies from simpler, focused interfaces. Supports composition over inheritance for modular, extensible systems.
Create new interfaces by combining existing ones, promoting composition and reusability. Embedded interface methods automatically included. Enables interface hierarchies from simpler, focused interfaces. Supports composition over inheritance for modular, extensible systems.
Visit the following resources to learn more:
- [@article@Struct Embedding](https://gobyexample.com/struct-embedding)
- [@article@Interfaces and Embedding in Golang (Go)](https://dev.to/diwakarkashyap/interfaces-and-embedding-in-golang-go-2em4)
@@ -1,3 +1,8 @@
# Embedding Structs
Struct embedding includes one struct inside another without field names, making embedded fields directly accessible. Provides composition-based design following Go's philosophy of composition over inheritance. Enables flexible, reusable components.
Struct embedding includes one struct inside another without field names, making embedded fields directly accessible. Provides composition-based design following Go's philosophy of composition over inheritance. Enables flexible, reusable components.
Visit the following resources to learn more:
- [@article@Struct Embedding](https://gobyexample.com/struct-embedding)
- [@article@Interfaces and Embedding in Golang (Go)](https://dev.to/diwakarkashyap/interfaces-and-embedding-in-golang-go-2em4)
@@ -1,3 +1,8 @@
# Empty Interface
The empty interface `interface{}` can hold values of any type since every type implements at least zero methods. Used for generic programming before Go 1.18 generics. Requires type assertions or type switches to access underlying values. Common in APIs handling unknown data types.
The empty interface `interface{}` can hold values of any type since every type implements at least zero methods. Used for generic programming before Go 1.18 generics. Requires type assertions or type switches to access underlying values. Common in APIs handling unknown data types.
Visit the following resources to learn more:
- [@article@Empty Interface](https://go.dev/tour/methods/14)
- [@article@Understanding the empty interface in Go](https://dev.to/flrnd/understanding-the-empty-interface-in-go-4652)
@@ -1 +1,8 @@
# encoding/json
# Encoding / JSON
This package provides robust and efficient functionalities for marshaling (encoding) Go data structures into JSON and unmarshaling (decoding) JSON into Go data structures. This process is largely handled through the json.Marshal and json.Unmarshal functions. For a Go struct to be properly encoded or decoded, its fields must be exported (start with an uppercase letter). Developers can control the JSON field names and omit empty fields using struct tags like json:"fieldName,omitempty".
Visit the following resources to learn more:
- [@article@Empty Interface](https://go.dev/tour/methods/14)
- [@article@Understanding the empty interface in Go](https://dev.to/flrnd/understanding-the-empty-interface-in-go-4652)
@@ -1,3 +1,9 @@
# Error Handling Basics
Go uses explicit error handling with error return values. Functions return error as last value. Check `if err != nil` pattern. Create errors with `errors.New()` or `fmt.Errorf()`. No exceptions - errors are values to be handled explicitly.
Go uses explicit error handling with error return values. Functions return error as last value. Check `if err != nil` pattern. Create errors with `errors.New()` or `fmt.Errorf()`. No exceptions - errors are values to be handled explicitly.
Visit the following resources to learn more:
- [@official@Error Handling and Go](https://go.dev/blog/error-handling-and-go)
- [@article@Mastering Error Handling in Go: A Comprehensive Guide](https://medium.com/hprog99/mastering-error-handling-in-go-a-comprehensive-guide-fac34079833f)
- [@article@Errors and Exception Handling in Golang](https://golangdocs.com/errors-exception-handling-in-golang)
@@ -1,3 +1,10 @@
# `error` interface
# error interface
Built-in interface with single `Error() string` method. Any type implementing this method can represent an error. Central to Go's error handling philosophy, providing consistent error representation across all Go code. Fundamental for effective error handling.
Built-in interface with single `Error() string` method. Any type implementing this method can represent an error. Central to Go's error handling philosophy, providing consistent error representation across all Go code. Fundamental for effective error handling.
Visit the following resources to learn more:
- [@official@Error Handling and Go](https://go.dev/blog/error-handling-and-go)
- [@article@The Error Interface](https://golang.ntxm.org/docs/error-handling-in-go/the-error-interface/)
- [@article@Mastering Error Handling in Go: A Comprehensive Guide](https://medium.com/hprog99/mastering-error-handling-in-go-a-comprehensive-guide-fac34079833f)
- [@article@Errors and Exception Handling in Golang](https://golangdocs.com/errors-exception-handling-in-golang)
@@ -1,3 +1,10 @@
# errors.New
Simplest way to create error values by taking a string message and returning an error implementing the error interface. Useful for simple, static error messages. Often combined with error wrapping or used for predefined error constants.
Simplest way to create error values by taking a string message and returning an error implementing the error interface. Useful for simple, static error messages. Often combined with error wrapping or used for predefined error constants.
Visit the following resources to learn more:
- [@official@Error Handling and Go](https://go.dev/blog/error-handling-and-go)
- [@article@The Error Interface](https://golang.ntxm.org/docs/error-handling-in-go/the-error-interface/)
- [@article@Mastering Error Handling in Go: A Comprehensive Guide](https://medium.com/hprog99/mastering-error-handling-in-go-a-comprehensive-guide-fac34079833f)
- [@article@Creating Custom Errors in Go](https://www.digitalocean.com/community/tutorials/creating-custom-errors-in-go)
@@ -1,3 +1,8 @@
# Escape Analysis
Compile-time optimization determining whether variables are allocated on stack (fast) or heap (GC required). Variables that "escape" their scope need heap allocation. Use `go build -gcflags="-m"` to view decisions. Understanding helps minimize heap allocations and reduce GC pressure.
Compile-time optimization determining whether variables are allocated on stack (fast) or heap (GC required). Variables that "escape" their scope need heap allocation. Use `go build -gcflags="-m"` to view decisions. Understanding helps minimize heap allocations and reduce GC pressure.
Visit the following resources to learn more:
- [@article@Escape Analysis in Go: Stack vs Heap Allocation Explained](https://dev.to/abstractmusa/escape-analysis-in-go-stack-vs-heap-allocation-explained-506a)
- [@article@Escape Analysis in Golang](https://medium.com/@trinad536/escape-analysis-in-golang-fc81b78f3550)
@@ -1,3 +1,8 @@
# Fan-in
Concurrency pattern merging multiple input channels into single output channel. Allows collecting results from multiple goroutines. Typically implemented with select statement or separate goroutines for each input. Useful for aggregating parallel processing results.
Concurrency pattern merging multiple input channels into single output channel. Allows collecting results from multiple goroutines. Typically implemented with select statement or separate goroutines for each input. Useful for aggregating parallel processing results.
Visit the following resources to learn more:
- [@article@Fan Out Fan In Concurrency Pattern Explained](https://www.golinuxcloud.com/go-fan-out-fan-in/)
- [@article@Golang Concurrency Patterns: Fan in, Fan out](https://medium.com/geekculture/golang-concurrency-patterns-fan-in-fan-out-1ee43c6830c4)
@@ -1,3 +1,8 @@
# Fan-out
Concurrency pattern distributing work from single source to multiple workers. Typically uses one input channel feeding multiple goroutines. Each worker processes items independently. Useful for parallelizing CPU-intensive tasks and increasing throughput through parallel processing.
Concurrency pattern distributing work from single source to multiple workers. Typically uses one input channel feeding multiple goroutines. Each worker processes items independently. Useful for parallelizing CPU-intensive tasks and increasing throughput through parallel processing.
Visit the following resources to learn more:
- [@article@Fan Out Fan In Concurrency Pattern Explained](https://www.golinuxcloud.com/go-fan-out-fan-in/)
- [@article@Golang Concurrency Patterns: Fan in, Fan out](https://medium.com/geekculture/golang-concurrency-patterns-fan-in-fan-out-1ee43c6830c4)
@@ -1,3 +1,11 @@
# fiber
Fiber is an Express-inspired web framework built on fasthttp for exceptional performance. Provides familiar API with middleware, routing, templates, and WebSocket support. Popular for high-performance REST APIs and microservices requiring speed and simplicity.
Fiber is an Express-inspired web framework built on fasthttp for exceptional performance. Provides familiar API with middleware, routing, templates, and WebSocket support. Popular for high-performance REST APIs and microservices requiring speed and simplicity.
Visit the following resources to learn more:
- [@official@Fiber](https://gofiber.io/)
- [@official@Fiber Documentation](https://docs.gofiber.io/)
- [@opensource@gofiber/fiber](https://github.com/gofiber/fiber)
- [@article@Fiber Framework in Golang](https://medium.com/@uzairahmed01/fiber-framework-in-golang-b5158499c9ad)
- [@article@Go Fiber: Start Building RESTful APIs on Golang](https://dev.to/percoguru/getting-started-with-apis-in-golang-feat-fiber-and-gorm-2n34)
@@ -1,3 +1,9 @@
# flag
Standard library package for parsing command-line flags. Supports string, int, bool, duration flags with default values and descriptions. Automatically generates help text. Simple API for basic CLI argument parsing before using frameworks like Cobra.
Standard library package for parsing command-line flags. Supports string, int, bool, duration flags with default values and descriptions. Automatically generates help text. Simple API for basic CLI argument parsing before using frameworks like Cobra.
Visit the following resources to learn more:
- [@official@Flag](https://go-language.org/go-docs/flag/)
- [@article@How To Use the Flag Package](https://www.digitalocean.com/community/tutorials/how-to-use-the-flag-package-in-go)
- [@article@Advanced Golang Flag Techniques](https://www.golinuxcloud.com/golang-flags-examples/)
@@ -1,3 +1,8 @@
# Floating Points
Two types: `float32` (single precision) and `float64` (double precision, default). Represent real numbers using IEEE 754 standard. Can introduce precision errors, not suitable for exact financial calculations. Essential for scientific computing and graphics.
Two types: `float32` (single precision) and `float64` (double precision, default). Represent real numbers using IEEE 754 standard. Can introduce precision errors, not suitable for exact financial calculations. Essential for scientific computing and graphics.
Visit the following resources to learn more:
- [@official@Floating Points](https://golangdocs.com/floating-point-numbers-in-golang)
- [@article@How to Perform Float Point Calculations](https://labex.io/tutorials/go-how-to-perform-float-point-calculations-419745)
@@ -1,3 +1,10 @@
# fmt.Errorf
Creates formatted error messages using printf-style verbs. Supports `%w` verb for error wrapping (Go 1.13+) to create error chains preserving original errors while adding context. Essential for descriptive errors with dynamic values and debugging information.
Creates formatted error messages using printf-style verbs. Supports `%w` verb for error wrapping (Go 1.13+) to create error chains preserving original errors while adding context. Essential for descriptive errors with dynamic values and debugging information.
Visit the following resources to learn more:
- [@official@fmt](https://pkg.go.dev/fmt)
- [@official@Error Handling and Go](https://go.dev/blog/error-handling-and-go)
- [@article@Mastering Error Handling in Golang: The Power of fmt.Errorf ()](https://thelinuxcode.com/mastering-error-handling-in-golang-the-power-of-fmt-errorf/)
- [@article@Understanding the fmt.Errorf Function in Golang](https://www.zetcode.com/golang/fmt-errorf/)
@@ -1,3 +1,8 @@
# for loop
Go's only looping construct, incredibly flexible for all iteration needs. Classic form: initialization, condition, post statements. Omit components for different behaviors (infinite, while-like). Use with `break`, `continue`, labels for nested loops. `for range` for convenient collection iteration.
Go's only looping construct, incredibly flexible for all iteration needs. Classic form: initialization, condition, post statements. Omit components for different behaviors (infinite, while-like). Use with `break`, `continue`, labels for nested loops. `for range` for convenient collection iteration.
Visit the following resources to learn more:
- [@official@for](https://go.dev/tour/flowcontrol/1)
- [@article@Learn for loops in Go with Examples](https://golangbot.com/loops/)
@@ -1,3 +1,9 @@
# for-range
Special form of for loop for iterating over arrays, slices, maps, strings, and channels. Returns index/key and value. For strings, returns rune index and rune value. For channels, returns only values. Use blank identifier `_` to ignore unwanted return values.
Special form of for loop for iterating over arrays, slices, maps, strings, and channels. Returns index/key and value. For strings, returns rune index and rune value. For channels, returns only values. Use blank identifier `_` to ignore unwanted return values.
Visit the following resources to learn more:
- [@official@Range](https://go.dev/wiki/Range)
- [@official@for](https://go.dev/tour/flowcontrol/1)
- [@article@Select & For Range Channel in Go](https://blog.devtrovert.com/p/select-and-for-range-channel-i-bet)
@@ -1,3 +1,8 @@
# Function Basics
Reusable code blocks declared with `func` keyword. Support parameters, return values, multiple returns. First-class citizens - can be assigned to variables, passed as arguments. Fundamental building blocks for organizing code logic.
Reusable code blocks declared with `func` keyword. Support parameters, return values, multiple returns. First-class citizens - can be assigned to variables, passed as arguments. Fundamental building blocks for organizing code logic.
Visit the following resources to learn more:
- [@official@Functions](https://go.dev/tour/basics/4)
- [@article@Functions in Golang: Complete Guide with Examples](https://medium.com/backend-forge/functions-in-golang-complete-guide-with-examples-2025-e07db0f98fd3)
@@ -1,3 +1,9 @@
# Functions
First-class citizens in Go. Declared with `func` keyword, support parameters and return values. Can be assigned to variables, passed as arguments, returned from other functions. Support multiple return values, named returns, and variadic parameters. Building blocks of modular code.
First-class citizens in Go. Declared with `func` keyword, support parameters and return values. Can be assigned to variables, passed as arguments, returned from other functions. Support multiple return values, named returns, and variadic parameters. Building blocks of modular code.
Visit the following resources to learn more:
- [@official@Functions](https://go.dev/tour/basics/4)
- [@article@Functions in Golang: Complete Guide with Examples](https://medium.com/backend-forge/functions-in-golang-complete-guide-with-examples-2025-e07db0f98fd3)
- [@article@Learn Go Functions](https://www.learn-golang.org/en/Functions)
@@ -1,3 +1,9 @@
# Garbage Collection
Go's GC automatically reclaims unreachable memory using concurrent, tri-color mark-and-sweep collector designed for minimal pause times. Runs concurrently with your program. Understanding GC helps write efficient programs that work well with automatic memory management.
Go's GC automatically reclaims unreachable memory using concurrent, tri-color mark-and-sweep collector designed for minimal pause times. Runs concurrently with your program. Understanding GC helps write efficient programs that work well with automatic memory management.
Visit the following resources to learn more:
- [@official@Garbage Collections](https://tip.golang.org/doc/gc-guide)
- [@article@Garbage Collection In Go](https://www.ardanlabs.com/blog/2018/12/garbage-collection-in-go-part1-semantics.html)
- [@article@Understanding Go's Garbage Collection](https://bwoff.medium.com/understanding-gos-garbage-collection-415a19cc485c)
@@ -1,3 +1,8 @@
# Generic Functions
Write functions working with multiple types using type parameters in square brackets like `func FunctionName[T any](param T) T`. Enable reusable algorithms maintaining type safety. Particularly useful for utility functions and data processing that don't depend on specific types.
Write functions working with multiple types using type parameters in square brackets like `func FunctionName[T any](param T) T`. Enable reusable algorithms maintaining type safety. Particularly useful for utility functions and data processing that don't depend on specific types.
Visit the following resources to learn more:
- [@official@Generic Functions](https://go.dev/doc/tutorial/generics)
- [@article@Generic Functions Comprehensive Guide](https://www.ardanlabs.com/blog/2018/12/garbage-collection-in-go-part1-semantics.html)
@@ -1,3 +1,9 @@
# Generic Types / Interfaces
Create reusable data structures and interface definitions working with multiple types. Define with type parameters like `type Container[T any] struct { value T }`. Enable type-safe containers, generic slices, maps, and custom structures while maintaining Go's strong typing.
Create reusable data structures and interface definitions working with multiple types. Define with type parameters like `type Container[T any] struct { value T }`. Enable type-safe containers, generic slices, maps, and custom structures while maintaining Go's strong typing.
Visit the following resources to learn more:
- [@official@Generic Functions](https://go.dev/doc/tutorial/generics)
- [@article@Interfaces](https://golangdocs.com/interfaces-in-golang)
- [@article@Understanding the Power of Go Interfaces](https://medium.com/@jamal.kaksouri/understanding-the-power-of-go-interfaces-a-comprehensive-guide-835954101b7e)
@@ -1,3 +1,8 @@
# Generics
Introduced in Go 1.18, allow functions and types to work with different data types while maintaining type safety. Enable reusable code without sacrificing performance. Use type parameters (square brackets) and constraints. Reduce code duplication while preserving strong typing.
Introduced in Go 1.18, allow functions and types to work with different data types while maintaining type safety. Enable reusable code without sacrificing performance. Use type parameters (square brackets) and constraints. Reduce code duplication while preserving strong typing.
Visit the following resources to learn more:
- [@official@Generic Functions](https://go.dev/doc/tutorial/generics)
- [@article@Understanding Generics](https://blog.logrocket.com/understanding-generics-go-1-18/)
@@ -1,3 +1,9 @@
# gin
Popular HTTP web framework emphasizing performance and productivity. Lightweight foundation for APIs/web services with minimal boilerplate. Fast routing, middleware, JSON validation, error management, built-in rendering. Clean API for RESTful services. Includes parameter binding, uploads, static files.
Popular HTTP web framework emphasizing performance and productivity. Lightweight foundation for APIs/web services with minimal boilerplate. Fast routing, middleware, JSON validation, error management, built-in rendering. Clean API for RESTful services. Includes parameter binding, uploads, static files.
Visit the following resources to learn more:
- [@official@Gin Web Framework](https://gin-gonic.com/)
- [@article@Building a RESTful API in Go Using the Gin Framework](https://medium.com/@godusan/building-a-restful-api-in-go-using-the-gin-framework-a-step-by-step-tutorial-part-1-2-70372ebfa988)
- [@article@Developing a RESTful API with Go and Gin](https://go.dev/doc/tutorial/web-service-gin)
@@ -1,3 +1,9 @@
# go build
Compiles Go packages and dependencies into executable binaries. Supports cross-compilation for different OS/architectures via GOOS/GOARCH. Includes build constraints, custom flags, optimization levels. Produces statically linked binaries by default. Essential for deployment and distribution.
Compiles Go packages and dependencies into executable binaries. Supports cross-compilation for different OS/architectures via GOOS/GOARCH. Includes build constraints, custom flags, optimization levels. Produces statically linked binaries by default. Essential for deployment and distribution.
Visit the following resources to learn more:
- [@official@Compile and Install the Application](https://go.dev/doc/tutorial/compile-install)
- [@article@How to Build and Run Go Programs](https://go-tutorial.com/build-and-run)
- [@article@How To Build and Install Go Programs](https://www.digitalocean.com/community/tutorials/how-to-build-and-install-go-programs)
@@ -1,3 +1,9 @@
# go clean
Removes object files and cached files from build process. Options include `-cache` for build cache and `-modcache` for module downloads. Useful for troubleshooting build issues, freeing disk space, and ensuring clean builds.
Removes object files and cached files from build process. Options include `-cache` for build cache and `-modcache` for module downloads. Useful for troubleshooting build issues, freeing disk space, and ensuring clean builds.
Visit the following resources to learn more:
- [@official@Clean](https://golang.google.cn/cmd/go/internal/clean/)
- [@article@Make sure to clean your Go build cache](https://www.adityathebe.com/how-to-clean-go-build-cache/)
- [@video@Golang Clean Architecture](https://www.youtube.com/watch?v=F5KLmp6aB5Q)
@@ -1,3 +1,10 @@
# `go` command
# go command
Primary tool for managing Go source code with unified interface for compiling, testing, formatting, and managing dependencies. Includes subcommands like `build`, `run`, `test`, `fmt`, `mod`. Handles the entire development workflow automatically.
Primary tool for managing Go source code with unified interface for compiling, testing, formatting, and managing dependencies. Includes subcommands like `build`, `run`, `test`, `fmt`, `mod`. Handles the entire development workflow automatically.
Visit the following resources to learn more:
- [@official@Command Documentation](https://go.dev/doc/cmd)
- [@official@Go Package](https://pkg.go.dev/cmd/go)
- [@official@Go Test](https://go.dev/doc/tutorial/add-a-test)
- [@official@Compile and Install Application](https://go.dev/doc/tutorial/compile-install)
@@ -1,3 +1,9 @@
# go doc
Prints documentation for Go packages, types, functions, and methods extracted from specially formatted comments. Use `go doc package` or `go doc package.Function` to view specific documentation. Essential for exploring APIs and verifying documentation formatting.
Prints documentation for Go packages, types, functions, and methods extracted from specially formatted comments. Use `go doc package` or `go doc package.Function` to view specific documentation. Essential for exploring APIs and verifying documentation formatting.
Visit the following resources to learn more:
- [@official@go doc](https://tip.golang.org/doc/comment)
- [@official@go package](https://pkg.go.dev/cmd/go)
- [@article@Documenting Your Go Code with go doc](https://go-cookbook.com/snippets/tools/go-doc)
@@ -1,3 +1,9 @@
# go fmt
Automatically formats Go source code according to official style guidelines. Standardizes indentation, spacing, alignment for consistent code style. Opinionated and non-configurable, eliminating formatting debates. Essential for clean, readable, community-standard code.
Automatically formats Go source code according to official style guidelines. Standardizes indentation, spacing, alignment for consistent code style. Opinionated and non-configurable, eliminating formatting debates. Essential for clean, readable, community-standard code.
Visit the following resources to learn more:
- [@official@go fmt](https://go.dev/blog/gofmt)
- [@official@fmt package](https://pkg.go.dev/fmt)
- [@article@go fmt Command Examples](https://www.thegeekdiary.com/go-fmt-command-examples/)
@@ -1,3 +1,9 @@
# go generate
The `go generate` command executes commands specified in `//go:generate` directives to generate Go source code. Used for code generation from templates, string methods, embedded resources, and running tools like protobuf compilers for build automation.
The `go generate` command executes commands specified in `//go:generate` directives to generate Go source code. Used for code generation from templates, string methods, embedded resources, and running tools like protobuf compilers for build automation.
Visit the following resources to learn more:
- [@official@go generate](https://go.dev/blog/generate)
- [@article@How to Use \/\/go\:generate](https://blog.carlana.net/post/2016-11-27-how-to-use-go-generate/)
- [@article@Metaprogramming with Go](https://dev.to/hlubek/metaprogramming-with-go-or-how-to-build-code-generators-that-parse-go-code-2k3j)
@@ -1,3 +1,9 @@
# go install
Compiles and installs packages and dependencies. Creates executables in `$GOPATH/bin` for main packages. Use `go install package@version` to install specific versions of tools. Commonly used for installing CLI tools system-wide.
Compiles and installs packages and dependencies. Creates executables in `$GOPATH/bin` for main packages. Use `go install package@version` to install specific versions of tools. Commonly used for installing CLI tools system-wide.
Visit the following resources to learn more:
- [@official@go install](https://go.dev/doc/install)
- [@official@Managing Go Installations](https://go.dev/doc/manage-install)
- [@article@Golang: How To Use the Go Install Command](https://thenewstack.io/golang-how-to-use-the-go-install-command/)
@@ -1,3 +1,9 @@
# go mod init
Initializes new Go module by creating `go.mod` file with specified module path (typically repository URL). Marks directory as module root and enables module-based dependency management. First step for any new Go project.
Initializes new Go module by creating `go.mod` file with specified module path (typically repository URL). Marks directory as module root and enables module-based dependency management. First step for any new Go project.
Visit the following resources to learn more:
- [@official@go mod](https://go.dev/doc/tutorial/create-module)
- [@official@go mod reference](https://go.dev/ref/mod)
- [@official@Initiating Go Modules with Go Mod Init Explained Simply](https://go.dev/blog/using-go-modules)
@@ -1,3 +1,10 @@
# go mod tidy
Ensures `go.mod` matches source code by adding missing requirements and removing unused dependencies. Updates `go.sum` with checksums. Essential for maintaining clean dependency management and ensuring reproducible builds before production deployment.
Ensures `go.mod` matches source code by adding missing requirements and removing unused dependencies. Updates `go.sum` with checksums. Essential for maintaining clean dependency management and ensuring reproducible builds before production deployment.
Visit the following resources to learn more:
- [@official@go mod create](https://go.dev/doc/tutorial/create-module)
- [@official@go mod reference](https://go.dev/ref/mod)
- [@article@go mod commands](https://blog.devtrovert.com/p/go-get-go-mod-tidy-commands)
- [@article@What does go mod tidy do?](https://golangbyexamples.com/go-mod-tidy/)
@@ -1,3 +1,9 @@
# go mod vendor
Creates `vendor` directory with dependency copies for bundling with source code. Ensures builds work without internet access. Useful for deployment, air-gapped environments, and complete control over dependency availability.
Creates `vendor` directory with dependency copies for bundling with source code. Ensures builds work without internet access. Useful for deployment, air-gapped environments, and complete control over dependency availability.
Visit the following resources to learn more:
- [@article@Vendoring, or go mod vendor: What Is It?](https://victoriametrics.com/blog/vendoring-go-mod-vendor/)
- [@article@go mod commands](https://blog.devtrovert.com/p/go-get-go-mod-tidy-commands)
- [@article@Go Modules and Vendors: Simplify Dependency Management](https://mahmoudaljadan.medium.com/go-modules-and-vendors-simplify-dependency-management-in-your-golang-project-a29689eb26b1)
@@ -1,3 +1,9 @@
# go mod
Command-line tool for module management. `go mod init` creates module, `go mod tidy` cleans dependencies, `go mod download` fetches modules. Manages go.mod and go.sum files. Essential commands for dependency management and version control.
Command-line tool for module management. `go mod init` creates module, `go mod tidy` cleans dependencies, `go mod download` fetches modules. Manages go.mod and go.sum files. Essential commands for dependency management and version control.
Visit the following resources to learn more:
- [@official@go mod](https://go.dev/doc/tutorial/create-module)
- [@article@go mod commands](https://blog.devtrovert.com/p/go-get-go-mod-tidy-commands)
- [@article@What does go mod tidy do?](https://golangbyexamples.com/go-mod-tidy/)
@@ -1,3 +1,9 @@
# go run
Compiles and executes Go programs in one step without creating executable files. Useful for testing, development, and running scripts. Takes Go source files as arguments. Convenient for quick execution during development without build artifacts.
Compiles and executes Go programs in one step without creating executable files. Useful for testing, development, and running scripts. Takes Go source files as arguments. Convenient for quick execution during development without build artifacts.
Visit the following resources to learn more:
- [@official@go run](https://go.dev/doc/tutorial/getting-started)
- [@article@How to Build and Run Go Programs](https://go-tutorial.com/build-and-run)
- [@article@How To Build and Install Go Programs](https://www.digitalocean.com/community/tutorials/how-to-build-and-install-go-programs)
@@ -1,3 +1,9 @@
# go test
Command for running tests in Go packages. Automatically finds and executes functions starting with `Test`. Supports benchmarks (`Benchmark`), examples (`Example`), and sub-tests. Includes coverage analysis, parallel execution, and various output formats. Essential for TDD and quality assurance.
Command for running tests in Go packages. Automatically finds and executes functions starting with `Test`. Supports benchmarks (`Benchmark`), examples (`Example`), and sub-tests. Includes coverage analysis, parallel execution, and various output formats. Essential for TDD and quality assurance.
Visit the following resources to learn more:
- [@official@go test](https://go.dev/doc/tutorial/add-a-test)
- [@article@How To Write Unit Tests in Go](https://www.digitalocean.com/community/tutorials/how-to-write-unit-tests-in-go-using-go-test-and-the-testing-package)
- [@article@Testing and Benchmarking in Go](https://medium.com/hyperskill/testing-and-benchmarking-in-go-e33a54b413e)
@@ -1,3 +1,9 @@
# Go Toolchain and Tools
The Go toolchain provides comprehensive development tools through the unified `go` command. It includes the compiler, linker, and utilities for compilation, dependency management, testing, and profiling. This integrated approach simplifies Go development with seamless, consistent tooling.
The Go toolchain provides comprehensive development tools through the unified `go` command. It includes the compiler, linker, and utilities for compilation, dependency management, testing, and profiling. This integrated approach simplifies Go development with seamless, consistent tooling.
Visit the following resources to learn more:
- [@official@Go Toolchains](https://go.dev/doc/toolchain)
- [@article@New in Go 1.21: Toolchains](https://dev.to/eminetto/new-in-go-121-toolchains-5gn0)
- [@article@How To Write Unit Tests in Go](https://www.digitalocean.com/community/tutorials/how-to-write-unit-tests-in-go-using-go-test-and-the-testing-package)
@@ -1,3 +1,9 @@
# go version
Displays the currently installed Go version, target OS, and architecture. Essential for verifying installation, troubleshooting environment issues, and ensuring compatibility across different development environments and teams.
Displays the currently installed Go version, target OS, and architecture. Essential for verifying installation, troubleshooting environment issues, and ensuring compatibility across different development environments and teams.
Visit the following resources to learn more:
- [@official@Go Versions](https://go.dev/dl/)
- [@article@Updating Go Version](https://www.golang101.com/questions/how-to-update-golang-version/)
- [@article@How to Check My Golang Version (Win, MacOS, Linux)](https://blog.finxter.com/how-to-check-my-golang-version-win-macos-linux/)
@@ -1,3 +1,9 @@
# go vet
Built-in tool analyzing Go source code for suspicious constructs likely to be bugs. Checks for unreachable code, incorrect printf formats, struct tag mistakes, and potential nil pointer dereferences. Automatically run by `go test`.
Built-in tool analyzing Go source code for suspicious constructs likely to be bugs. Checks for unreachable code, incorrect printf formats, struct tag mistakes, and potential nil pointer dereferences. Automatically run by `go test`.
Visit the following resources to learn more:
- [@official@go vet](https://pkg.go.dev/cmd/vet)
- [@article@Go: Vet Command Is More Powerful Than You Think](https://medium.com/a-journey-with-go/go-vet-command-is-more-powerful-than-you-think-563e9fdec2f5)
- [@article@Using go vet for Code Analysis](https://medium.com/a-journey-with-go/go-vet-command-is-more-powerful-than-you-think-563e9fdec2f5)
@@ -1,3 +1,9 @@
# go:embed for embedding
The `go:embed` directive embeds files and directories into Go binaries at compile time using `//go:embed` comments. Useful for including static assets, configs, and templates directly in executables, creating self-contained binaries that don't require external files.
The `go:embed` directive embeds files and directories into Go binaries at compile time using `//go:embed` comments. Useful for including static assets, configs, and templates directly in executables, creating self-contained binaries that don't require external files.
Visit the following resources to learn more:
- [@official@go embed](https://pkg.go.dev/embed)
- [@article@A Guide to Embedding Static Files in Go](https://www.iamyadav.com/blogs/a-guide-to-embedding-static-files-in-go)
- [@article@How to Use go:embed in Go?](https://www.scaler.com/topics/golang/golang-embed/)
@@ -1,3 +1,9 @@
# goimports
Tool automatically managing Go import statements by adding missing imports and removing unused ones while formatting code. More convenient than manual import management, integrates with editors for automatic execution on save.
Tool automatically managing Go import statements by adding missing imports and removing unused ones while formatting code. More convenient than manual import management, integrates with editors for automatic execution on save.
Visit the following resources to learn more:
- [@official@go import](https://go.dev/tour/basics/2)
- [@article@An introduction to Packages, Imports and Modules in Go](https://www.alexedwards.net/blog/an-introduction-to-packages-imports-and-modules)
- [@article@Unraveling Packages and Imports in Golang](https://medium.com/hprog99/unraveling-packages-and-imports-in-golang-a-comprehensive-guide-8f0ea320562a)
@@ -1,3 +1,9 @@
# golangci-lint
Fast, parallel runner for multiple Go linters including staticcheck, go vet, and revive. Provides unified configuration, output formatting, and performance optimization. Streamlines code quality workflows through a single comprehensive tool.
Fast, parallel runner for multiple Go linters including staticcheck, go vet, and revive. Provides unified configuration, output formatting, and performance optimization. Streamlines code quality workflows through a single comprehensive tool.
Visit the following resources to learn more:
- [@official@golangci-lint](https://golangci-lint.run/)
- [@official@golangci-linters](https://golangci-lint.run/usage/linters/)
- [@opensource@golangci/golangci-lint](https://github.com/golangci/golangci-lint)
@@ -1,3 +1,9 @@
# GORM
Popular Object-Relational Mapping library for Go. Provides database abstraction with struct-based models, automatic migrations, associations, and query building. Supports multiple databases (MySQL, PostgreSQL, SQLite, SQL Server). Features hooks, transactions, and connection pooling.
Popular Object-Relational Mapping library for Go. Provides database abstraction with struct-based models, automatic migrations, associations, and query building. Supports multiple databases (MySQL, PostgreSQL, SQLite, SQL Server). Features hooks, transactions, and connection pooling.
Visit the following resources to learn more:
- [@official@GORM - The fantastic ORM library for Golang](https://gorm.io/)
- [@official@gorm package](https://pkg.go.dev/gorm.io/gorm)
- [@article@Getting Started on Golang Gorm](https://medium.com/@itskenzylimon/getting-started-on-golang-gorm-af49381caf3f)
@@ -1,3 +1,9 @@
# Goroutines
Lightweight threads managed by Go runtime enabling concurrent function execution. Created with `go` keyword prefix. Minimal memory overhead, can run thousands/millions concurrently. Runtime handles scheduling across CPU cores. Communicate through channels, fundamental to Go's concurrency.
Lightweight threads managed by Go runtime enabling concurrent function execution. Created with `go` keyword prefix. Minimal memory overhead, can run thousands/millions concurrently. Runtime handles scheduling across CPU cores. Communicate through channels, fundamental to Go's concurrency.
Visit the following resources to learn more:
- [@official@Goroutines](https://go.dev/tour/concurrency/1)
- [@article@Goroutines - Concurrency in Golang](https://golangbot.com/goroutines/)
- [@article@Goroutines in Golang: Understanding and Implementing](https://medium.com/@jamal.kaksouri/goroutines-in-golang-understanding-and-implementing-concurrent-programming-in-go-600187bcfaa2)
@@ -1,3 +1,9 @@
# goto (discouraged)
Go includes `goto` statement but discourages its use. Can only jump to labels within same function. Creates unstructured code flow making programs hard to read, debug, and maintain. Use structured control flow (loops, functions, conditionals) instead. Rarely needed in modern Go programming.
Go includes `goto` statement but discourages its use. Can only jump to labels within same function. Creates unstructured code flow making programs hard to read, debug, and maintain. Use structured control flow (loops, functions, conditionals) instead. Rarely needed in modern Go programming.
Visit the following resources to learn more:
- [@article@Goto Statement Usage](https://labex.io/tutorials/go-goto-statement-usage-149074)
- [@article@GoLang — Jumping in the code using goto](https://medium.com/@rajasoni1995/golang-jumping-in-the-code-using-goto-a36116831396)
- [@article@Goto Hell With Labels in Golang](https://programmingpercy.tech/blog/goto-hell-with-labels-in-golang/)
@@ -1,3 +1,8 @@
# govulncheck
Go's official vulnerability scanner checking code and dependencies for known security vulnerabilities. Reports packages with vulnerabilities from Go database, provides severity info and remediation advice. Essential for maintaining secure applications.
Go's official vulnerability scanner checking code and dependencies for known security vulnerabilities. Reports packages with vulnerabilities from Go database, provides severity info and remediation advice. Essential for maintaining secure applications.
Visit the following resources to learn more:
- [@official@govulncheck](https://go.dev/doc/tutorial/govulncheck)
- [@article@Using govulncheck to Detect Vulnerable Dependencies in Go](https://medium.com/@caring_smitten_gerbil_914/%EF%B8%8F-using-govulncheck-to-detect-vulnerable-dependencies-in-go-627a634f1edd)
@@ -1,3 +1,9 @@
# gRPC & Protocol Buffers
gRPC is a high-performance RPC framework using Protocol Buffers for serialization. Provides streaming, authentication, load balancing, and code generation from `.proto` files. Excellent for microservices with type safety, efficient binary format, and cross-language compatibility.
gRPC is a high-performance RPC framework using Protocol Buffers for serialization. Provides streaming, authentication, load balancing, and code generation from `.proto` files. Excellent for microservices with type safety, efficient binary format, and cross-language compatibility.
Visit the following resources to learn more:
- [@official@gRPC package](https://pkg.go.dev/google.golang.org/grpc)
- [@article@Building a GRPC Micro-Service in Go: A Comprehensive Guide](https://medium.com/@leodahal4/building-a-grpc-micro-service-in-go-a-comprehensive-guide-82b6812ed253)
- [@article@Understanding gRPC in Golang: A Comprehensive Guide](https://dev.to/madhusgowda/understanding-grpc-in-golang-a-comprehensive-guide-with-examples-84c)
@@ -1,3 +1,10 @@
# Hello World in Go
Traditional first program demonstrating basic structure: `package main`, importing `fmt`, and `main()` function using `fmt.Println()`. Teaches Go syntax, compilation, execution, and verifies development environment setup. Entry point for learning Go.
Traditional first program demonstrating basic structure: `package main`, importing `fmt`, and `main()` function using `fmt.Println()`. Teaches Go syntax, compilation, execution, and verifies development environment setup. Entry point for learning Go.
Visit the following resources to learn more:
- [@official@Go Documentation](https://go.dev/doc/)
- [@official@Get Started with Go](https://go.dev/doc/tutorial/getting-started)
- [@article@Getting Started with Go and the Web](https://dev.to/markmunyaka/getting-started-with-go-and-the-web-hello-world-nal)
- [@article@Understanding Golang: A Comprehensive Guide](https://www.learn-golang.org/en/Hello%2C_World%21)
@@ -1,3 +1,9 @@
# History of Go
Created at Google in 2007 by Griesemer, Pike, and Thompson. Announced publicly in 2009, version 1.0 in 2012. Key milestones include modules (Go 1.11) and generics (Go 1.18). Designed for large-scale software development combining efficiency and simplicity.
Created at Google in 2007 by Griesemer, Pike, and Thompson. Announced publicly in 2009, version 1.0 in 2012. Key milestones include modules (Go 1.11) and generics (Go 1.18). Designed for large-scale software development combining efficiency and simplicity.
Visit the following resources to learn more:
- [@official@Go Documentation](https://go.dev/doc/)
- [@article@Go — How It All Began. A look back at the beginning of Go](https://medium.com/geekculture/learn-go-part-1-the-beginning-723746f2e8b0)
- [@article@Understanding Golang: A Comprehensive Guide](https://www.learn-golang.org/en/Hello%2C_World%21)
@@ -1,3 +1,9 @@
# `httptest` for HTTP Tests
The `httptest` package provides utilities for testing HTTP servers and clients without network connections. Includes `httptest.Server`, `ResponseRecorder`, and helpers for creating test requests. Essential for testing handlers, middleware, and HTTP services.
The `httptest` package provides utilities for testing HTTP servers and clients without network connections. Includes `httptest.Server`, `ResponseRecorder`, and helpers for creating test requests. Essential for testing handlers, middleware, and HTTP services.
Visit the following resources to learn more:
- [@official@httptest package](https://pkg.go.dev/net/http/httptest)
- [@article@Using httptest.Server in Go to Mock and Test External API Calls](https://medium.com/@ullauri.byron/using-httptest-server-in-go-to-mock-and-test-external-api-calls-68ce444cf934)
- [@article@Httptest Example](https://golang.cafe/blog/golang-httptest-example.html)
@@ -1,3 +1,8 @@
# if-else
Basic conditional statements for binary decision making. `if` tests condition, `else` handles alternative path. Can include optional initialization statement. No parentheses needed around condition but braces required. Foundation of program control flow.
Basic conditional statements for binary decision making. `if` tests condition, `else` handles alternative path. Can include optional initialization statement. No parentheses needed around condition but braces required. Foundation of program control flow.
Visit the following resources to learn more:
- [@official@if else](https://go.dev/tour/flowcontrol/7)
- [@article@If-else: Gobyexample](https://gobyexample.com/if-else)
@@ -1,3 +1,9 @@
# if
Basic conditional statement for executing code based on boolean conditions. Supports optional initialization statement before condition check. No parentheses required around condition but braces mandatory. Can be chained with else if for multiple conditions. Foundation of control flow.
Basic conditional statement for executing code based on boolean conditions. Supports optional initialization statement before condition check. No parentheses required around condition but braces mandatory. Can be chained with else if for multiple conditions. Foundation of control flow.
Visit the following resources to learn more:
- [@official@if else](https://go.dev/tour/flowcontrol/7)
- [@article@If-else: Gobyexample](https://gobyexample.com/if-else)
- [@article@Understanding the If Statement in Golang](https://www.zetcode.com/golang/if-else-keywords/)
@@ -1,3 +1,8 @@
# Integers (Signed, Unsigned)
Signed integers (int8, int16, int32, int64) handle positive/negative numbers. Unsigned (uint8, uint16, uint32, uint64) handle only non-negative but larger positive range. `int`/`uint` are platform-dependent. Choose based on range and memory needs.
Signed integers (int8, int16, int32, int64) handle positive/negative numbers. Unsigned (uint8, uint16, uint32, uint64) handle only non-negative but larger positive range. `int`/`uint` are platform-dependent. Choose based on range and memory needs.
Visit the following resources to learn more:
- [@article@Integers](https://golangdocs.com/integers-in-golang)
- [@article@Understanding Integer Types in Go](https://medium.com/@LukePetersonAU/understanding-integer-types-in-go-a55453f5ae00)
@@ -1,3 +1,9 @@
# Interfaces Basics
Define contracts through method signatures. Types automatically satisfy interfaces by implementing required methods. Declared with `type InterfaceName interface{}` syntax. Enable polymorphism and flexible, testable code depending on behavior rather than concrete types.
Define contracts through method signatures. Types automatically satisfy interfaces by implementing required methods. Declared with `type InterfaceName interface{}` syntax. Enable polymorphism and flexible, testable code depending on behavior rather than concrete types.
Visit the following resources to learn more:
- [@article@Understanding Interfaces in Go](https://golang.ntxm.org/docs/structs-and-interfaces/understanding-interfaces-in-go/)
- [@article@Interfaces - Go by Example](https://gobyexample.com/interfaces)
- [@article@Mastering Go Interfaces: From Basics to Best Practices](https://abubakardev0.medium.com/mastering-go-interfaces-from-basics-to-best-practices-36912b65aa3d)
@@ -1,3 +1,8 @@
# Interfaces
Define contracts specifying method signatures without implementation. Types satisfy interfaces implicitly by implementing required methods. Enable polymorphism and loose coupling. Empty interface `interface{}` accepts any type. Foundation of Go's type system and composition patterns.
Define contracts specifying method signatures without implementation. Types satisfy interfaces implicitly by implementing required methods. Enable polymorphism and loose coupling. Empty interface `interface{}` accepts any type. Foundation of Go's type system and composition patterns.
Visit the following resources to learn more:
- [@article@Interfaces - Go by Example](https://gobyexample.com/interfaces)
- [@article@Mastering Go Interfaces: From Basics to Best Practices](https://abubakardev0.medium.com/mastering-go-interfaces-from-basics-to-best-practices-36912b65aa3d)
@@ -1,3 +1,8 @@
# Interpreted String Literals
Enclosed in double quotes (`"`) and process escape sequences like `\n`, `\t`, `\"`. Support Unicode characters and formatting. Most common string type, ideal for text needing control characters but requiring escaping of special characters.
Enclosed in double quotes (`"`) and process escape sequences like `\n`, `\t`, `\"`. Support Unicode characters and formatting. Most common string type, ideal for text needing control characters but requiring escaping of special characters.
Visit the following resources to learn more:
- [@article@How to handle string literal syntax](https://www.digitalocean.com/community/tutorials/an-introduction-to-working-with-strings-in-go)
- [@article@Lexical elements: Interpreted string literals](https://boldlygo.tech/archive/2023-01-30-lexical-elements-interpreted-string-literals/)
@@ -1,3 +1,10 @@
# Introduction to Go
Statically typed, compiled programming language developed at Google. Designed for simplicity, concurrency, and performance. Features garbage collection, strong typing, efficient compilation, built-in concurrency with goroutines and channels. Excellent for backend services, CLI tools, and distributed systems.
Statically typed, compiled programming language developed at Google. Designed for simplicity, concurrency, and performance. Features garbage collection, strong typing, efficient compilation, built-in concurrency with goroutines and channels. Excellent for backend services, CLI tools, and distributed systems.
Visit the following resources to learn more:
- [@official@Go](https://go.dev/)
- [@official@Go Documentation](https://go.dev/doc/)
- [@official@Get Started with Go](https://go.dev/doc/tutorial/getting-started)
- [@article@Getting Started with Go and the Web](https://dev.to/markmunyaka/getting-started-with-go-and-the-web-hello-world-nal)
@@ -1,3 +1,9 @@
# I/O & File Handling
Go's I/O system provides comprehensive file and stream handling through `io` package interfaces (Reader, Writer, Closer) and `os` package file operations. The interface-based design allows working with files, network connections, and buffers using consistent patterns.
Go's I/O system provides comprehensive file and stream handling through `io` package interfaces (Reader, Writer, Closer) and `os` package file operations. The interface-based design allows working with files, network connections, and buffers using consistent patterns.
Visit the following resources to learn more:
- [@article@Building High-Performance File Processing Pipelines in Go](https://dev.to/aaravjoshi/building-high-performance-file-processing-pipelines-in-go-a-complete-guide-3opm)
- [@article@Mastering File I/O in Go: A Complete Guide](https://thelinuxcode.com/golang-os-open/)
- [@article@Golang Fundamentals: File Handling and I/O](https://medium.com/@nagarjun_nagesh/golang-fundamentals-file-handling-and-i-o-502d50b96795)
@@ -1,3 +1,9 @@
# Iterating Maps
Use `for range` to iterate over maps, returns key and value pairs. Iteration order is random for security reasons. Use blank identifier `_` to ignore key or value. Cannot modify map during iteration unless creating new map. Safe to delete during iteration.
Use `for range` to iterate over maps, returns key and value pairs. Iteration order is random for security reasons. Use blank identifier `_` to ignore key or value. Cannot modify map during iteration unless creating new map. Safe to delete during iteration.
Visit the following resources to learn more:
- [@article@Building High-Performance File Processing Pipelines in Go](https://dev.to/aaravjoshi/building-high-performance-file-processing-pipelines-in-go-a-complete-guide-3opm)
- [@article@Mastering File I/O in Go: A Complete Guide](https://thelinuxcode.com/golang-os-open/)
- [@article@Golang Fundamentals: File Handling and I/O](https://medium.com/@nagarjun_nagesh/golang-fundamentals-file-handling-and-i-o-502d50b96795)
@@ -1,3 +1,9 @@
# Iterating Strings
Iterate over strings with `for range` to get runes (Unicode code points) not bytes. Returns index and rune value. Direct indexing `str[i]` gives bytes. Use `[]rune(str)` to convert to rune slice for random access. Important for Unicode handling.
Iterate over strings with `for range` to get runes (Unicode code points) not bytes. Returns index and rune value. Direct indexing `str[i]` gives bytes. Use `[]rune(str)` to convert to rune slice for random access. Important for Unicode handling.
Visit the following resources to learn more:
- [@article@Iterators in GoLang](https://blog.alexoglou.com/posts/iterators-golang/)
- [@article@How to iterate string in Go](https://labex.io/tutorials/go-how-to-iterate-string-in-go-446115)
- [@article@Mastering Golang String Manipulation: Functions and Examples](https://learngolanguage.com/mastering-golang-string-manipulation-essential-functions-and-techniques-for-2024/)

Some files were not shown because too many files have changed in this diff Show More