Cool libraries, frameworks, tips and tricks and anything that can be useful to share.
Inspired by awesome-go, for Lantern.
General tools, hacks and techniques with wide usage
- Preeny - Make it easier to interact with services locally. It can disable fork(), rand(), and alarm() and can convert a server application to a console one.
- Ratelimit - Simple, thread-safe Go rate-limiter.
- Gopacket - Provides packet processing capabilities for Go.
Tools for interference detection, probing and network analysis in general
Testing utilities and libraries
- Go-fuzz - Randomized testing (fuzzing). Mainly applicable to packages that parse complex inputs (both text and binary).
- Stress - The stress utility is intended for catching of episodic failures. It runs a given process in parallel in a loop and collects any failures.
Libraries for network testing.
- Linkio - Network link speed simulation for Reader/Writer interfaces.
- Toxiproxy - Proxy to simulate network and system conditions for automated tests.
- Comcast - Simulation of bad network connections.
- Gor - HTTP traffic replay in real-time. Replay traffic from production to staging and dev environments. Test code on real user sessions in an automated and repeatable fashion.
- netem - Network Emulation functionality for testing protocols by emulating the properties of wide area networks. The current version emulates variable delay, loss, duplication and re-ordering.
Tools to generate HTTP traffic
Tools for checking code style and related
- Errcheck - Checking for unchecked errors in go programs.
- Golint - A linter for Go source code.
- GoMetaLinter - Concurrently runs a whole bunch of linters.
Static code analysis tools that will help you gain insight of the codebase
- Oracle - The go oracle is a source analysis tool that answers questions about Go programs.
Refactoring tools specific for Go
- Gorename - Precise type-safe renaming of identifiers in Go source code.
- Gomvpkg - Move go packages, updating import declarations.
- Goimports - Update Go import lines, adding missing ones and removing unreferenced ones.
- Eg - Example-based refactoring tool (better instructions running it).
Tools to inspect and study the program behavior at runtime
- Race detection -
go test -race
- GC tracing -
GODEBUG=gctrace=1 go run <file.go>
- Scheduler tracing (info) -
GODEBUG=schedtrace=1000 go run <file.go>
- Generic tracing (info) - The capability is compiled into all programs always, and is enabled on demand -- when tracing is disabled it has minimal runtime overhead. That is, the trace can be obtained from a server in production serving live traffic. For visualization, use Google's trace viewer, or type the URL
chrome://tracing
for an embedded UI in Chrome. - panicparse - Groups similar goroutines and colorizes stack dump.