ax(mining): replace prose comment on WithDefaults with usage example
Some checks are pending
Security Scan / security (push) Waiting to run
Test / test (push) Waiting to run

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:
Claude 2026-04-02 08:11:16 +01:00
parent 72d85986c6
commit 6bcd0494af
No known key found for this signature in database
GPG key ID: AF404715446AEB41

View file

@ -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