feat(blogo,metadata)!: return ErrImmutable if Map's underlying map is nil

This commit is contained in:
Guz
2025-01-24 16:28:57 -03:00
parent 81998f4baf
commit f9220c409d

View File

@@ -176,13 +176,16 @@ func (m Map) Get(key string) (any, error) {
func (m Map) Set(key string, v any) error {
if m == nil {
return nil
return ErrImmutable
}
m[key] = v
return nil
}
func (m Map) Delete(key string) error {
if m == nil {
return ErrImmutable
}
delete(m, key)
return nil
}