update modifies the rep for bu via the supplied function.
(fn func(r *binrep))
| 83 | |
| 84 | // update modifies the rep for bu via the supplied function. |
| 85 | func (bu *Binutils) update(fn func(r *binrep)) { |
| 86 | r := &binrep{} |
| 87 | bu.mu.Lock() |
| 88 | defer bu.mu.Unlock() |
| 89 | if bu.rep == nil { |
| 90 | initTools(r, "") |
| 91 | } else { |
| 92 | *r = *bu.rep |
| 93 | } |
| 94 | fn(r) |
| 95 | bu.rep = r |
| 96 | } |
| 97 | |
| 98 | // String returns string representation of the binutils state for debug logging. |
| 99 | func (bu *Binutils) String() string { |
no test coverage detected