Skip to content

Commit 3e0a4f4

Browse files
authored
Merge pull request #115 from krzysztofgb/error-cuddling-doc-fix
Update configuration and rules doc for error cuddling
2 parents ae82899 + a205a1d commit 3e0a4f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

doc/configuration.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ if 1 == 1 {
301301
}
302302
```
303303

304-
### [enforce-err-cuddling](rules.md#if-statements-that-check-an-error-must-be-cuddled-with-the-statement-that-assigned-the-error)
304+
### [force-err-cuddling](rules.md#if-statements-that-check-an-error-must-be-cuddled-with-the-statement-that-assigned-the-error)
305305

306306
Enforces that an `if` statement checking an error variable is cuddled with the line that assigned that error variable.
307307

@@ -362,4 +362,4 @@ if err != nil {
362362
```
363363

364364
**Note**: this means the option _overrides_ the
365-
[enforce-err-cuddling](#enforce-err-cuddling) option above, among others.
365+
[force-err-cuddling](#force-err-cuddling) option above, among others.

doc/rules.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1016,7 +1016,7 @@ switch inSwitch.(type) {
10161016
### If statements that check an error must be cuddled with the statement that assigned the error
10171017

10181018
> Can be configured, see [configuration
1019-
documentation](configuration.md#enforce-err-cuddling)
1019+
documentation](configuration.md#force-err-cuddling)
10201020

10211021
When an `if` statement checks a variable named `err`, which was assigned on the line above, it should be cuddled with that assignment. This makes clear the relationship between the error check and the call that may have resulted in an error.
10221022

0 commit comments

Comments
 (0)