MCPcopy Create free account
hub / github.com/cloud-native-go/examples / Get

Method Get

ch08/hexarch/core/core.go:50–60  ·  view source on GitHub ↗
(key string)

Source from the content-addressed store, hash-verified

48}
49
50func (store *KeyValueStore) Get(key string) (string, error) {
51 store.RLock()
52 value, ok := store.m[key]
53 store.RUnlock()
54
55 if !ok {
56 return "", ErrorNoSuchKey
57 }
58
59 return value, nil
60}
61
62func (store *KeyValueStore) Put(key string, value string) error {
63 store.Lock()

Callers 1

TestGetFunction · 0.95

Calls

no outgoing calls

Tested by 1

TestGetFunction · 0.76