gobstore/get.go
2025-01-12 02:51:51 -07:00

11 lines
229 B
Go

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
}