MCPcopy Index your code
hub / github.com/TheAlgorithms/Go / Get

Method Get

structure/hashmap/hashmap.go:41–47  ·  view source on GitHub ↗

Get returns the value associated with the given key

(key any)

Source from the content-addressed store, hash-verified

39
40// Get returns the value associated with the given key
41func (hm *HashMap) Get(key any) any {
42 node := hm.getNodeByKey(key)
43 if node != nil {
44 return node.value
45 }
46 return nil
47}
48
49// Put inserts a new key-value pair into the hashmap
50func (hm *HashMap) Put(key, value any) {

Callers

nothing calls this directly

Calls 1

getNodeByKeyMethod · 0.95

Tested by

no test coverage detected