From 6bcd0494afdbb449258e894cccd18c416159c2e4 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 08:11:16 +0100 Subject: [PATCH] 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 --- pkg/mining/repository.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/mining/repository.go b/pkg/mining/repository.go index d41adc0..ae92431 100644 --- a/pkg/mining/repository.go +++ b/pkg/mining/repository.go @@ -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