diff options
Diffstat (limited to 'internal/object')
| -rw-r--r-- | internal/object/item_store.go | 2 | ||||
| -rw-r--r-- | internal/object/store.go | 1 |
2 files changed, 3 insertions, 0 deletions
diff --git a/internal/object/item_store.go b/internal/object/item_store.go index 8bc85e4..e930220 100644 --- a/internal/object/item_store.go +++ b/internal/object/item_store.go @@ -40,6 +40,7 @@ func (s *ItemStore) Load(id string) (*ItemDef, error) { if err := yaml.Unmarshal(data, &def); err != nil { return nil, fmt.Errorf("parse item %s: %w", id, err) } + def.ID = id s.cache[id] = &def return &def, nil } @@ -56,6 +57,7 @@ func (s *ItemStore) LoadAll() ([]*ItemDef, error) { if err := yaml.Unmarshal(data, &def); err != nil { return fmt.Errorf("parse item %s: %w", id, err) } + def.ID = id s.cache[id] = &def defs = append(defs, &def) return nil diff --git a/internal/object/store.go b/internal/object/store.go index a11ff7a..cf8b4f9 100644 --- a/internal/object/store.go +++ b/internal/object/store.go @@ -39,6 +39,7 @@ func (s *ObjectStore) Load(id string) (*ObjectDef, error) { if err := yaml.Unmarshal(data, &def); err != nil { return nil, fmt.Errorf("parse object %s: %w", id, err) } + def.ID = id s.cache[id] = &def return &def, nil } |
