Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions docs/development_guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

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:

Expand All @@ -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**:
Expand Down
Loading