From fdc100ad4edf7b53de5726f4e6b014baa350b5ab Mon Sep 17 00:00:00 2001 From: Skoow <89569841+Skoowshot@users.noreply.github.com> Date: Sun, 15 Nov 2026 11:24:36 +0500 Subject: [PATCH] refactor: use *Store instead of Store in store.Registry --- internal/store/registry.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/store/registry.go b/internal/store/registry.go index 8e3cf15..87ce075 100644 --- a/internal/store/registry.go +++ b/internal/store/registry.go @@ -8,7 +8,7 @@ import ( // Registry maps ID to Store and Name to ID. type Registry struct { nextID uint64 - byID map[ID]Store + byID map[ID]*Store nameToID map[Name]ID mu sync.RWMutex } @@ -16,13 +16,13 @@ type Registry struct { // NewRegistry creates a Registry. func NewRegistry() *Registry { return &Registry{ - byID: make(map[ID]Store), + byID: make(map[ID]*Store), nameToID: make(map[Name]ID), } } // Put maps the given Store by a generated ID, and maps the given Name to generated ID. -func (r *Registry) Put(name Name, store Store) (ID, error) { +func (r *Registry) Put(name Name, store *Store) (ID, error) { r.mu.Lock() defer r.mu.Unlock() @@ -38,7 +38,7 @@ func (r *Registry) Put(name Name, store Store) (ID, error) { } // Get returns the Store by ID. -func (r *Registry) Get(id ID) (Store, bool) { +func (r *Registry) Get(id ID) (*Store, bool) { r.mu.RLock() defer r.mu.RUnlock()