ax(mining): replace implementation-describing comment with call-site example on saveUnlocked
AX Principle 2: comments show HOW to call, not WHAT the body does. The old comment restated the lock/defer mechanics; the new comment shows the caller context (Save and Update) so an agent knows when saveUnlocked is the right call. Co-Authored-By: Charon <charon@lethean.io>
This commit is contained in:
parent
f766f06c18
commit
ba72f3e408
1 changed files with 1 additions and 1 deletions
|
|
@ -83,7 +83,7 @@ func (r *FileRepository[T]) Save(data T) error {
|
|||
return r.saveUnlocked(data)
|
||||
}
|
||||
|
||||
// r.mutex.Lock(); defer r.mutex.Unlock(); return r.saveUnlocked(data)
|
||||
// return r.saveUnlocked(data) // called by Save and Update while mutex is held
|
||||
func (r *FileRepository[T]) saveUnlocked(data T) error {
|
||||
dir := filepath.Dir(r.path)
|
||||
if err := os.MkdirAll(dir, 0755); err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue