diff options
| author | 2025-11-16 00:00:00 +0000 | |
|---|---|---|
| committer | 2025-11-16 00:00:00 +0000 | |
| commit | 5c15542025c98f89d65331ff01b28daa389cf2a6 (patch) | |
| tree | 18a4cf7eb79ef81d63b9c658dc42b21e69e1282e /repo.go | |
| parent | repo is thread safe (diff) | |
| signature | ||
Fix some docs and API types
Diffstat (limited to 'repo.go')
| -rw-r--r-- | repo.go | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -16,6 +16,9 @@ import ( // // It is safe to access the same Repository from multiple goroutines // without additional synchronization. +// +// Objects derived from a Repository must not be used after the Repository +// has been closed. type Repository struct { rootPath string hashSize int @@ -82,6 +85,13 @@ func OpenRepository(path string) (*Repository, error) { return &Repository{rootPath: path, hashSize: hashSize}, nil } +// Close closes the repository, releasing any resources associated with it. +// +// It is safe to call Close multiple times; subsequent calls will have no +// effect. +// +// Close invalidates any objects derived from the Repository as it; +// using them may cause segmentation faults or other undefined behavior. func (repo *Repository) Close() error { var closeErr error repo.closeOnce.Do(func() { |
