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()