ax(mining): rename opts/opt to options/option in NewFileRepository
AX Principle 1: predictable names over short names. `opts` and `opt` are abbreviations — `options` and `option` are unambiguous. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
40b57849ff
commit
f9ecce2e86
1 changed files with 4 additions and 4 deletions
|
|
@ -39,13 +39,13 @@ func WithDefaults[T any](fn func() T) FileRepositoryOption[T] {
|
|||
}
|
||||
}
|
||||
|
||||
// NewFileRepository creates a new file-based repository.
|
||||
func NewFileRepository[T any](path string, opts ...FileRepositoryOption[T]) *FileRepository[T] {
|
||||
// repo := NewFileRepository[MinersConfig](path, WithDefaults(defaultMinersConfig))
|
||||
func NewFileRepository[T any](path string, options ...FileRepositoryOption[T]) *FileRepository[T] {
|
||||
r := &FileRepository[T]{
|
||||
path: path,
|
||||
}
|
||||
for _, opt := range opts {
|
||||
opt(r)
|
||||
for _, option := range options {
|
||||
option(r)
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue