ax(mining): replace prose comment on WithDefaults with usage example
AX Principle 2: comments show HOW with real values, not what the signature already says. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
72d85986c6
commit
6bcd0494af
1 changed files with 1 additions and 1 deletions
|
|
@ -32,7 +32,7 @@ type FileRepository[T any] struct {
|
|||
// FileRepositoryOption configures a FileRepository.
|
||||
type FileRepositoryOption[T any] func(*FileRepository[T])
|
||||
|
||||
// WithDefaults sets the default value factory for when the file doesn't exist.
|
||||
// repo := NewFileRepository[MinersConfig](path, WithDefaults(defaultMinersConfig))
|
||||
func WithDefaults[T any](fn func() T) FileRepositoryOption[T] {
|
||||
return func(r *FileRepository[T]) {
|
||||
r.defaults = fn
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue