(key string, i int)
| 13 | } |
| 14 | |
| 15 | func (table *HashTable) Add(key string, i int) { |
| 16 | position := generateHash(key) |
| 17 | if table.data[position] == nil { |
| 18 | table.data[position] = &TableItem{key: key, data: i} |
| 19 | return |
| 20 | } |
| 21 | current := table.data[position] |
| 22 | for current.next != nil { |
| 23 | current = current.next |
| 24 | } |
| 25 | current.next = &TableItem{key: key, data: i} |
| 26 | } |
| 27 | |
| 28 | func (table *HashTable) Get(key string) (int, bool) { |
| 29 | position := generateHash(key) |
nothing calls this directly
no test coverage detected