gobstore/get.go

12 lines
229 B
Go
Raw Normal View History

2025-01-12 09:51:51 +00:00
package gobstore
// Get returns a value from the store if it exists
func (j *GobStore[T]) Get(key string) (T, bool) {
j.Lock()
defer j.Unlock()
// res := j.load()
v, ok := j.values[key]
// v, ok := res[key]
return v, ok
}