This page, for now, is mostly links to either Go code or articles about Go programming. As I go through them I will remove, comment, or categorize the links.
I’ve had decent luck with the Go subreddit on Reddit. I like it better than Stackoverflow.
Packages
Learning Go
- An Introduction to Programming in Go
- Effective Go
- Go 101 - an on-line introduction to Go book
- Go Books
- Go By Example
- Go Go-To Guide
- Gophercises
- The Go Programming Language Specification - the specification document for Go
- Understand Go’s Specification - a helper for the specification
- Learn Go With Tests
- Let’s Go - a digitial book you can purchase
- Slice Tricks - examples of tricks with slices
- Slice Tricks Cheet Sheet - illustrated slice tricks
- Standard Library - the Go standard library documentation
- Test With Go
- tour.golang.org
- 50 Shades of Go: Traps, Gotchas, and Common Mistakes for New Golang Devs
- learngo - 1000+ Hand-Crafted Go Examples, Exercises, and Quizzes
Videos
I have a ton of Go-related videos saved in my Youtube account. Here are a few of my favorites.
Talks (mostly)
- The Go Programming Language - seems to be dead, but has a lot of videos most of which are still relevant
- Package Main - not updated a lot, but has some recent videos (as of mid-2020)
- Gopher Academy - lots of talks about Go and the Go community
Programming
- Ardan Labs - short videos covering the basics of Go
- Just For Func - hasn’t been updated much recently but has a lot of very good videos. More programming-centric than some of the others
- Things In Go I Never Use
- Two Go Programs Three Different Profiling Techniques
- Go Development With vim-go
- Go Proverbs
- also see here
- Write Less Code Generate More
- Rethinking Classical Concurrency Patterns
Testing
- Advanced Testing With Go - great talk given by a founder of Hashicorp
- The Art of Writing Idiomatic Test Code
- Unit Testing A Golang Application That Includes HTTP
Articles / Blogs
Blogs
- Ardan Labs Blog
- blog.golang.org
- Dave Cheney’s Blog
- Functional options for friendly APIs
- Let’s talk about logging
- How to write benchmarks in Go
- Inlining optimisations in Go
- Ensmallening Go binaries by prohibiting comparisons
- Building a high performance JSON parser
- Don’t force allocations on the callers of your API
- Don’t just check errors handle them gracefully
- High Performance Go Workshop
- Gopher Academy Blog
- Advanced Encoding and Decoding Techniques - Advanced encoding and decoding of JSON
- Probabilistic Data Structures for Go: Bloom Filters
- Go Beyond
- The Green Place
- Ilija Eftimov’s Blog
- Rakyll
- Russ Cox’s Blog
Compiling / Linking
- Go: Builds & Linker’s Timeline
- Shrink Your Go Binaries With This One Weird Trick
- Statically compiled Go programs, always, even with cgo, using musl
Context
- Peter Bourgon on Context
- Golang: Context is Not For Dependency Injection and a Solution
- Context should go away for Go 2
- Why context.Value matters and how to improve it
Database / Datastore / SQL
- DotSQL - A Golang library for using SQL
- Improving Postgres Performance Tenfold Using Go Concurrency
- MySQL Tutorial: Connecting to MySQL and Creating a DB using Go
- SQLC - Generate type safe Go from SQL
- Squirrel - Fluent SQL generation for golang
- Working with SQL Relations in Go - Part 1
Errors
- Better Error Handling
- Don’t Panic - removal of usage of panics for returning errors; discusses errgroup
- Elegance of Go’s error handling
- Error Handling in Upspin
- Failure is your Domain
- Go: Multiple Errors Management
- Golang: Six Error Handling techniques to help you write elegant code
- Handling Errors in Your HTTP Handlers
Guides
- Go Code Review Comments
- Go Developer Roadmap
- Uber Style Guide
- Go Clean Arch - example implementation of clean architecture in Go
- Go Proverbs
- How To Write a Go API - several part series
- A Comprehensive Guide To Go Generate - Go Generate
Interfaces
- Crash Course on Go Interfaces
- Defining Interfaces Locally - includes lots of code samples
- Interface segregation in action with Go
- The Trouble With Optional Interfaces
- All Go Interfaces
- Best Practices For Writing Clean Interfaces in Go
- Composition over Inheritance in Go
- Implementing Golang Interfaces; Like a Boss
- Go Interfaces Deep Dive
- Go Interface Examples
JSON / JSON Parsing
- How to Work with Arbitrary JSON in Go?
- simdjson-go: Parsing gigabytes of JSON per second in Go
- Speeding up json processing in go
- Unmarshalling odd and irregular JSON in Go
- Unmarshaling Time values from JSON
- Use Anonymous Structs For JSON Marshalling in Go
- The Ultimate Guide to JSON in Go
Linting / Code Analysis
Logging
Memory
- Escape Analysis In Go Part 1
- Usage of the Heap Data Structure in Go (Golang), with Examples
- Go memory ballast: How I learnt to stop worrying and love the heap
Microservices / Web Development / HTTP
- HTTP/2 Cleartext (H2C) Client Example in Go
- Increasing http.Server boilerplate
- Microservices in Golang - Part 1
- Scaling Websocket in Go and Beyond
- What is Micro? It's Just the Future of Microservices Development
- 7 tips on how to write kick-ass high performance Golang microservices
- Go kit vs. Micro vs. Gizmo Comparison: What the Internet is Saying
- How I write Go HTTP services after seven years
- Go Swagger Tips
- Swagger UI setup for Go REST API using Swaggo
- Different approaches to HTTP routing in Go
- Build web applications with golang - an on-line book. This goes directly to the English version, but there are others
- Building a new router for GOV.UK
- Different approaches to HTTP routing in Go
- How to not use an http-router in go
- Problems with the net/http Client API - post by Brad Fitz about the standard lib http client
Modules / Release / Code Organization
- Semantic Import Versioning is unsound
- Go’s Major Versioning Sucks
- Organize Local Code in Packages Using Go Modules
- Golang project structures for independent teams: A better way to go
- Go Modules versus Docker & private dependencies
- How to bump a Go package to v2.0.0
- Developing Modules - golang.org docs about developing with modules
- Managing Dependdencies - golang.org docs about managing dependencies with modules
Profiling / Performance
- Casual Profiling For Go
- Most efficient probabilistic datastructure in go - profiling of several cuckoo/bloom filter implementations
- Go Performance Optimization - Thoughts on Go performance optimization
Project Layout
- go-weball-example - Example web application written in Go
- Project Layout - YOU PROBABLY DON’T WANT TO USE THIS (see here)
- Standard Package Layout
- Style Guidline for Go Packages
Testing
- How To Avoid Parallel Execution of Tests in Go
- Mocked method not working in golang while running the test cases
- Run integration tests separately
- Increase Golang web app testing speed by over 2 times with parallel testing and more
- Testing in Go: Clean Tests Using t.Cleanup
- What’s New In Go 1.14: Test Cleanup
- Outsmarting Go Dependencies in Testing Code
- Testing in Go: WebSockets
- How to Unit Test a GORM Application With Sqlmock
- Advanced Go Table Driven Tests
- Testing Go Better
- 5 simple tips and tricks for writing unit tests in #golang
- How I write my unit tests in Go quickly
- Fuzzing In Go
- Getting Started with go-fuzz
- Mocking Techniques For Go
- Golang Integration Testing
- Go: Best Practices For Production Environments
Uncategorized
Mostly a disorganized list of articles that I would like to read. I plan on organizing them over time. This is not an endorsement of the content of any of these articles.
- Concurrency In Go
- Go: Slice and Memory Management
- Applying The Clean Architecture to Go applications
- Mastering Wire
- “for” statement and its all faces in Golang
- What “accept interfaces, return structs” means in Go
- The Flyweight Pattern in Go
- Why doesn’t Go have variance in its type system?
- Domain Driven Design in Golang - Tactical Design
- Maintaining consistency in codebases with Go Vet
- Slice Tricks
- Illustrated Tales of Go Runtime Scheduler.
- A visual guide to Go Memory Allocator from scratch
- Building an intelligent cache (memoization) in 2 steps
- Five Best Practices for GoLang CI/CD
- Event Sourcing in Go
- Go: How Does gops Interact with the Runtime?
- Goimports explained
- Go: Asynchronous Preemption
- So you want to expose Go on the Internet
- Go: How to Take Advantage of the Symbols Table
- Building Uber’s Go Monorepo with Bazel
- When to use pointers in Go
- A Simple Golang Application via Kubernetes
- Instrumentation in Go
- Type Aliases vs Type Definitions in GO
- Getting started with Golang plugins
- Optional function parameters in Go
- Hedged requests — Tackling tail latency
- Futures in Go, no package required
- Duck Typing vs Structural Typing vs Nominal Typing
- Generate, Monitor and Throttle CPU Load in Go
- Channel Use Cases
- 24 Common Mistakes In GO (gotchas) And How To Avoid Them
- Generics are the Generics of Go
- Polymorphism with Functions in Go
- So You Wanna Go Fast? - writing high performance go
- Transitioning API Boundaries
- Notes on structured concurrency, or: Go statement considered harmful
- Increase the Reliability of a Go Codebase with Object Constructors
- 5 Gotchas of Defer in Go — Part I
- Go command support for embedded static assets (files)
- Dependency Injection in Go using Fx Series
- Hash Table Implementation in Go
- Golang pattern: graceful shutdown of concurrent events
- Function Types in Go
Code
What you probably want is pkg.go.dev.
A simple categorization of Go package links I’ve collected.
Compiling / Linking / Cross Compiling
- gopherjs - A compiler from Go to JavaScript for running Go code in a browser
- gowut - Go Web UI Toolkit
- xgo - Go CGO cross compiler
Config / Flags
- cobra - A Commander for modern Go CLI interactions
- ff - Flags-first package for configuration
- viper - Go configuration with fangs
Database / Datastore
- dbr - additions to Go’s database/sql for super fast performance and convenience
- Ent - An entity framework for Go
- go-pg - Golang ORM with focus on PostgreSQL features and performance
- goose - database migration tool
- gorm - The fantastic ORM library for Golang
- migrate - Database migrations
- pgx - PostgreSQL driver and toolkit
- pq - Pure Go Postgres driver for database/sql
- sql-migrate - SQL schema migration tool
- sqlx - general purpose extensions to golang’s database/sql
- tern - db migration tool
Development With Vim / Neovim
Documentation
- godoc-static - Generate static Go documentation
Errors
- Errwrap - library for wrapping and querying errors
- errgroup - drop-in replacement for stdlib errgroup
- errlog - Reduce debugging time while programming Go
Formatting
- golines - formatter that fixes long lines
Goroutine Maintenance / Management
- run - a universal mechanism to manage goroutine lifecycles
- tomb - clean goroutine tracking and termination
Interpreters
JSON / JSON Parsing
- easyjson - Fast JSON serializer
- fastjson - Fast JSON parser and validator
- gjson - Get JSON values quickly
- go-json - Fast JSON encoder/decoder compatible with encoding/json
- jsonparser - One of the fastest alternative JSON parser
- json-to-go - converts JSON to a go struct
- json-to-struct - a simple command-line tool for generating to struct definitions from JSON
- ojg - JSON parser
- simdjson - Parsing gigabytes of JSON per second
Linting / Code Analysis
- errcheck - linter for unchecked errors
- Go Linters
- goanalyzer - improved go tool trace goroutine analysis
- goda - Dependency Analysis toolkit
- gogrep - Search for Go code using syntax trees
- golangci-lint - fast linter runner for go
- awesome go linters - from the golangci-lint site. Many of these are already built in to golangci-lint.
- go-ruleguard - Define and run pattern-based custom linting rules
- ls-lint - file and directory name linter
- nolint - turn off linting for specific lines in your code
- revive - ~6x faster, stricter, configurable, extensible, and beautiful drop-in replacement for golint
Load Testing
- Goad - Goad is an AWS Lambda powered, highly distributed, load testing tool
- Shibuya - Shibuya is a scheduler for load generator
- Vegeta - Vegeta is a versatile HTTP load testing tool
Logging
- onelog - dead simple, super fast, zero allocation and modular logger
- logrus - structured, pluggable logging
- zap - blazing fast, structured, leveled logging in Go.
- zerolog - fast and simple logger dedicated to JSON output
Microservices / Web Development / HTTP
- Aah
- Alice - painless middleware chaining for Go
- Beego - high-performance web framework
- Bone - lightning fast http multiplexer
- Buffalo
- Buffalo Swagger - middleware to automatically generate RESTful API documentation with Swagger 2.0
- Chi
- Echo
- Echo Swagger - middleware to automatically generate RESTful API documentation with Swagger 2.0
- Fiber
- Gin
- Gin Swagger - middleware to automatically generate RESTful API documentation with Swagger 2.0
- Gizmo
- Goa
- Go Feature Flag - A simple and complete feature flag solution, without any complex backend system to install, you need only a file as your backend
- Go Kit
- Go Micro
- Gorilla - a number of web-related libraries
- Goyave
- grpc-gateway
- httprouter
- http swagger - net/http wrapper to automatically generate RESTful API documentation with Swagger 2.0
- iris - web framework
- oapi-codegen
- pat - Sinatra style pattern muxer for Go’s net/http library
- revel - web framework
- treemux - fast and flexible HTTP router
- websocket - minimal and idiomatic WebSocket library
- ws - tiny WebSocket library
Modules / Release / Code Organization
- gomajor - tool for helping upgrade the major version of a module
- giredore - Giredore is an utility that does go-import redirects right
- Go Releaser - Release Go projects as fast and easily as possible
Plugins
Pretty Printing
- litter - pretty printer library
- spew - implements a deep pretty printer
- utter - implements a deep pretty printer
Profiling
- fgprof - a sampling Go profiler that allows you to analyze On-CPU as well as Off-CPU (e.g. I/O) time together
- profile - simple profiling for Go
SCM / Git / GitHub
- Gitbatch - manage your git repositories in one place
- go-git - A highly extensible Git implementation in pure Go
- go-github - client for GitHub API v3
- lazygit - simple terminal UI for git commands
Templates / Templating
- go-template - An automatic cross-compiling Go (golang) repository template using goreleaser and Github actions
- templatecheck - Checking Go templates for validity
Testing / Mocking
- copyist - Mocking your SQL database in Go tests has never been easier
- dockertest - run your Go language integration tests against third party services
- gnomock - test your code without writing mocks with ephemeral Docker containers
- gotests - automatically generate Go test boilerplate from your source code
- gotestsum - ‘go test’ output formatting
- go-fuzz - randomized testing
- go-junit-report
- go2xunit
- Moq - Interface mocking tool for go generate
- Testify - A toolkit with common assertions and mocks that plays nicely with the standard library
Validation
- govalidator - Package of validators and sanitizers for strings, numerics, slices and structs
- ozzo-validation - An idiomatic Go validation package. Supports configurable and extensible validation rules (validators) using normal language constructs instead of error-prone struct tags. (NOTE: should review algorithm before using, may be O(n^2))
- validator - Go Struct and Field validation, including Cross Field, Cross Struct, Map, Slice and Array diving
Uncategorized
I have not had a chance to organize much of this. Just a dump of links.
- Go Cloud - The Go Cloud Development Kit
- nsq - NSQ is a realtime distributed messaging platform
- Athens - Athens is a Server for Your Go Packages
- traefik - modern HTTP reverse proxy and load balancer
- Go Resilience - Go toolkit to increase the resilience of applications
- Proteus - A simple tool for generating an application’s data access layer.
- circuitbreaker - an easy way to use the Circuit Breaker pattern in a Go program.
- watermelon - Watermelon is a tool for building infrastructure as code
- go-trader - A financial exchange written in Go
- httpretty - httpretty prints the HTTP requests of your Go programs pretty on your terminal screen
- asynq - Go library for queueing tasks and processing them asynchronously with workers
- Ratelimit Manager - Allows you to respect the ratelimits from different hosts across multiple containers, threads, or processes
- dex - A federated OpenID Connect provider
- typex - Filter and examine Go type structures, interfaces and their transitive dependencies and relationships
- cron - a cron library for go
- goneli - Implementation of the NELI leader election protocol for Go and Kafka
- enum2go - enum defintions generator
- fx - An application framework for Go
- gold - Go local docs server, Go docs generator, and a Go code reader
- vssh - Execute Commands Over SSH at Scale
- msgp - MessagePack Code Generator
- goweight - analyze/troubleshoot a go binary
- compandauth - see accompanying article
- scheduler - cron-like job scheduler
- supermonkey - monkey patching
- evio - Fast event-loop networking for Go
- fuzzy - fuzzy string matching
- strcase - Convert strings to snake_case, camelCase, PascalCase, kebab-case
- gosec - Golang Security Checker (linter)
- vfsgen - Takes an input http.FileSystem and generates Go code that statically implements it
- gohalt - Go Throttler library
- casbin - authorization library that supports access control models like ACL, RBAC, ABAC
- buf - A new way of working with Protocol Buffers (more details)
- bingo - CI Automating versioning of Go binaries in a nested, isolated Go modules
- gistfs - A Go io/fs filesystem implementation for reading files in a Github gist
- go-bindata - Turn data file into go code
- depth - Visualize Go dependency trees
- task - A task runner / simpler Make alternative written in Go
- simplewire - Lightweight dependency injection framework for Go
- go-resume - A resume tailoring tool
- go-ruleguard - Define and run pattern-based custom linting rules
- go-reflect - Zero-allocation reflection library
- go-getter - download things from a string URL using a variety of protocols
- language server protocol - Package protocol implements Language Server Protocol specification in Go
- jsonrpc2 - Package jsonrpc2 an implementation of the JSON-RPC 2 specification for Go
- pipeline - A library to help you create pipelines in Golang