}

Articles tagged "golang"

Page 1 of 3

15 min readIntermediate

Go Goroutines and Channels: Production Concurrency Patterns (2026)

Master Go goroutines and channels with production patterns: worker pools, fan-out/fan-in, context cancellation, semaphores, and pipeline patterns — with benchmarks and real-world examples.

7 min readIntermediate

Go Concurrency: Goroutines, Channels and sync.WaitGroup with Real Examples (2026)

Master Go concurrency: goroutines, channels, sync.WaitGroup, Mutex, select, and worker pools with real-world examples. Avoid common mistakes.

8 min readIntermediate

Go REST API with Gin: From Zero to Production (2026)

Build a production-ready REST API in Go using the Gin framework. Includes routing, middleware, JSON responses, PostgreSQL integration, and Docker deployment.

4 min readBeginner

SOLVED: function main is undeclared in the main package (Go)

Fix Go error "function main is undeclared in the main package". Causes: wrong package name, missing main(), running go run on wrong file, or build tags.

6 min readIntermediate

Fix 'cannot use X (type Y) as type Z' in Go — Type Mismatch Guide

Fix 'cannot use X (type Y) as type Z' in Go. Covers explicit conversions, interface satisfaction, pointer vs value receivers, and type assertions with the ok pattern.

5 min readBeginner

Go: Convert Rune to String and String to Rune — Complete Guide (2026)

Convert rune to string in Go with string(r). Convert string to rune slice with []rune(s). Covers Unicode, utf8 package, for range iteration, and rune vs byte.

6 min readBeginner

Go: Convert String to Int (and Int to String) — Complete Guide (2026)

Convert string to int in Go using strconv.Atoi, strconv.ParseInt, fmt.Sscanf. Convert int to string with strconv.Itoa, FormatInt, Sprintf. All methods compared.

5 min readBeginner

Fix 'declared and not used' Error in Go (2026)

Fix Go's 'declared and not used' compile error. Learn why Go enforces this, how to use the blank identifier _, and common cases like loop variables and error returns.

6 min readBeginner

Fix: "function main is undeclared in the main package" in Go

Fix the Go error "runtime.main_main·f: function main is undeclared in the main package". Covers all 5 causes with code examples and step-by-step solutions.

5 min readBeginner

go mod tidy Explained: Clean Up Go Module Dependencies (2026)

go mod tidy adds missing and removes unused dependencies from go.mod and go.sum. Learn go mod download, verify, vendor, -e flag, and common post-tidy errors.