From 1ad014e71c23cec45a8245f8f91dda21df041eea Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 2 Apr 2026 09:04:34 +0100 Subject: [PATCH] ax(mining): replace prose comments with usage examples in repository.go Three comments on Path, Exists, and Delete restated what the signatures already convey. Replaced with concrete call examples per AX Principle 2. Co-Authored-By: Charon --- pkg/mining/repository.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/mining/repository.go b/pkg/mining/repository.go index a8c1b5a..fdf6cd0 100644 --- a/pkg/mining/repository.go +++ b/pkg/mining/repository.go @@ -133,12 +133,12 @@ func (r *FileRepository[T]) Update(fn func(*T) error) error { return r.saveUnlocked(data) } -// Path returns the file path of this repository. +// path := repo.Path() // => "/home/user/.config/lethean-desktop/miners.json" func (r *FileRepository[T]) Path() string { return r.path } -// Exists returns true if the repository file exists. +// if !repo.Exists() { return defaults, nil } func (r *FileRepository[T]) Exists() bool { r.mu.RLock() defer r.mu.RUnlock() @@ -147,7 +147,7 @@ func (r *FileRepository[T]) Exists() bool { return err == nil } -// Delete removes the repository file. +// if err := repo.Delete(); err != nil { return err } func (r *FileRepository[T]) Delete() error { r.mu.Lock() defer r.mu.Unlock()