Skip to content

Commit

Permalink
fix stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
zakirullin committed May 4, 2024
1 parent bbdd386 commit 1dec889
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ if isValid && isAllowed && isSecure {
## Nested ifs
```go
if isValid { // 🧠+, okay nested code applies to valid input only
if isSecure { // 🧠++, we do stuff1 for valid and secure input only
stuff1 // 🧠+++
if isSecure { // 🧠++, we do stuff for valid and secure input only
stuff // 🧠+++
}
}
```
Expand All @@ -109,7 +109,7 @@ if !isSecure

// 🧠, we don't really care about earlier returns, if we are here then all good

stuff1 // 🧠+
stuff // 🧠+
```

We can focus on the happy path only, thus freeing our working memory from all sorts of preconditions.
Expand Down

0 comments on commit 1dec889

Please sign in to comment.