Skip to content

Commit da7b738

Browse files
committed
move longer code snippet into block
1 parent 3724e45 commit da7b738

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

content/posts/better-options-in-go.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,11 @@ func NewFarmer(...opts func(*FarmerOptions)) *Farmer {
4545
}
4646
```
4747

48-
Now creating a farmer that doesn't collect oranges looks like this `farmer := NewFarmer(DisableOrangeCollection())`.
48+
Now creating a farmer that doesn't collect oranges looks like this.
49+
50+
```go
51+
farmer := NewFarmer(DisableOrangeCollection())
52+
```
4953

5054
But, this is where the simplicity of the example starts to belie the value of this new pattern, and to be fair the pattern is overkill for the logic required by this option. To get a better understanding of the pattern's strengths let's look at a real example from fuego - `OptionAddResponse`.
5155

0 commit comments

Comments
 (0)