mirror of
https://github.com/teivah/100-go-mistakes.git
synced 2026-06-21 00:47:11 +08:00
commit
62ad12f1b2
1 changed files with 1 additions and 1 deletions
|
|
@ -215,7 +215,7 @@ Using type embedding consciously by keeping these constraints in mind can help a
|
|||
Although there are different implementations with minor variations, the main idea is as follows:
|
||||
|
||||
* An unexported struct holds the configuration: options.
|
||||
* Each option is a function that returns the same type: `type Option func(options *options)` error. For example, `WithPort` accepts an `int` argument that represents the port and returns an `Option` type that represents how to update the `options` struct.
|
||||
* Each option is a function that returns the same type: `type Option func(options *options) error`. For example, `WithPort` accepts an `int` argument that represents the port and returns an `Option` type that represents how to update the `options` struct.
|
||||
|
||||

|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue