From e10cb0174efc980d8a26b0c086c5d95dfae5322c Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Mon, 4 Aug 2025 16:34:18 +0200 Subject: [PATCH] docs: explain what "visual symmetry" means --- docs/development_guidelines.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/development_guidelines.md b/docs/development_guidelines.md index 532e8951b..88c249a51 100644 --- a/docs/development_guidelines.md +++ b/docs/development_guidelines.md @@ -230,9 +230,13 @@ value, err := bar( ) ``` -As long as the visual symmetry of the opening and closing parentheses is -preserved, arguments that would otherwise introduce a new level of indentation -are allowed to be written in a more compact form. +As long as the visual symmetry of the opening and closing parentheses (or curly +braces) is preserved, arguments that would otherwise introduce a new level of +indentation are allowed to be written in a more compact form. +Visual symmetry here means that when two or more opening parentheses or curly +braces are on the same line, then they must also be closed on the same line. +And the closing line needs to have the same indentation level as the opening +line. Example with inline struct creation: @@ -254,6 +258,13 @@ Example with inline struct creation: }) ``` +**WRONG** +```go + response, err := node.AddInvoice(ctx, &lnrpc.Invoice{ + Memo: "invoice", + ValueMsat: int64(oneUnitMilliSat - 1)}) +``` + Example with nested function call: **ACCEPTABLE**: