go-modern-guidelines
Help AI coding agents write modern Go
Discover supported guideline IDs like G001 in the JetBrains Go Modern Guidelines CLI. Learn how normalizeGuidelineIDs normalizes input for efficient use.
Why `time.Tick` in Go 1.23+ No Longer Needs Explicit `Stop` Calls for Garbage CollectionDiscover how Go 1.23+ handles `time.Tick` automatically, eliminating goroutine leaks and manual Stop calls. Learn about improved garbage collection for tickers.
cmp.Or Evaluation Semantics vs. Inline If-Else Chains in GoUnderstand cmp.Or evaluation semantics vs. if-else chains in Go. Learn how cmp.Or eagerly evaluates arguments, ensuring side effects always execute.
How to Migrate from `encoding/json` to `encoding/json/v2`: A Complete Guide for Go 1.27+Learn the recommended migration strategy from encoding/json to encoding/json/v2 in Go 1.27+. Run both side-by-side, preserve legacy behavior, and gradually adopt stricter defaults.
How errors.AsType[T] Provides Compile-Time Type Safety Over errors.AsDiscover how errors.AsType[T] provides compile-time type safety over errors.As by leveraging Go generics to enforce type correctness, eliminating runtime checks.
How `context.AfterFunc` Prevents Goroutine Leaks Over Manual `ctx.Done()` WatchingDiscover how context.AfterFunc prevents goroutine leaks by registering callbacks directly with context cancellation, avoiding manual ctx.Done() watching and memory accumulation.
Edge Cases for `maps.Delete` vs Manual Delete Loops in GoExplore Go edge cases: maps.DeleteFunc panics on nil maps, unlike built-in delete. Learn which map deletion method to use for robust code.
WaitGroup.Go Pattern vs Manual Add/Done in Go: A Safety ComparisonExplore the WaitGroup Go pattern vs manual Add Done for safer Go concurrency. Learn how WaitGroup Go prevents race conditions and boilerplate for streamlined parallel execution.
encoding/json/v2 vs encoding/json in Go 1.27+: Impact and Migration GuideExplore the impact of encoding/json/v2 vs encoding/json in Go 1.27+. Understand strict validation changes and wire-format incompatibilities. Get a migration guide now.
How to Add a New Guideline to guidelines.json and Regenerate Documentation in Go Modern GuidelinesLearn how to add a new guideline to guidelines.json and regenerate documentation in Go Modern Guidelines. Follow our simple steps to update your project's guidelines.
Why go-modern-guidelines Requires Go 1.25+ and How It Handles Older ToolchainsDiscover why go-modern-guidelines needs Go 1.25+ and how it manages older toolchains. Learn about automatic downloads for seamless upgrades.
How the supportedGuidelines Function Filters Guidelines by Go VersionLearn how supportedGuidelines filters Go guidelines by version using goversion.Compare, keeping only those matching your target Go version.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →