Skip to content

Commit 066d2f6

Browse files
committed
idiom/functional-options: fix formatting and naming
1 parent 065ae23 commit 066d2f6

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ __Idioms__:
104104

105105
| Pattern | Description |
106106
|:-------:| ----------- |
107-
| [Functional Options](idiom/functional_options.md) | Allows creating clean APIs with sane defaults and idiomatic overrides |
107+
| [Functional Options](idiom/functional-options.md) | Allows creating clean APIs with sane defaults and idiomatic overrides |
108108

109109
__Anti-Patterns__:
110110

idiom/functional_options.md renamed to idiom/functional-options.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
# Functional Options
2+
23
Functional options are a method of implementing clean/eloquent APIs in Go.
34
Options implemented as a function set the state of that option.
45

56
## Implementation
67

78
### Options
9+
810
```go
911
package file
1012

@@ -44,6 +46,7 @@ func Permissions(perms os.FileMode) Option {
4446
```
4547

4648
### Constructor
49+
4750
```go
4851
package file
4952

@@ -77,6 +80,7 @@ func New(filepath string, setters ...Option) error {
7780
```
7881

7982
## Usage
83+
8084
```go
8185
emptyFile, err := file.New("/tmp/empty.txt")
8286
if err != nil {

0 commit comments

Comments
 (0)