Lookup returns the Info with the given name.
(name string)
| 59 | |
| 60 | // Lookup returns the Info with the given name. |
| 61 | func Lookup(name string) *Info { |
| 62 | // binary search, avoiding import of sort. |
| 63 | lo := 0 |
| 64 | hi := len(All) |
| 65 | for lo < hi { |
| 66 | m := int(uint(lo+hi) >> 1) |
| 67 | mid := All[m].Name |
| 68 | if name == mid { |
| 69 | return &All[m] |
| 70 | } |
| 71 | if name < mid { |
| 72 | hi = m |
| 73 | } else { |
| 74 | lo = m + 1 |
| 75 | } |
| 76 | } |
| 77 | return nil |
| 78 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…