From d78046f93a37386e2800019dc6ad251cf06cd93b Mon Sep 17 00:00:00 2001 From: sauran Date: Wed, 1 Oct 2025 04:45:29 +0500 Subject: [PATCH] Enhance Go development instructions by emphasizing the use of early return patterns to improve code clarity --- instructions/go.instructions.md | 1 + 1 file changed, 1 insertion(+) diff --git a/instructions/go.instructions.md b/instructions/go.instructions.md index 738c191..a956d62 100644 --- a/instructions/go.instructions.md +++ b/instructions/go.instructions.md @@ -14,6 +14,7 @@ Follow idiomatic Go practices and community standards when writing Go code. Thes - Follow the principle of least surprise - Keep the happy path left-aligned (minimize indentation) - Return early to reduce nesting +- Prefer early return over if-else chains; use `if condition { return }` pattern to avoid else blocks - Make the zero value useful - Write self-documenting code with clear, descriptive names - Document exported types, functions, methods, and packages