242cb22719
This change is the result of using the errcheck tool (https://github.com/kisielk/errcheck) to find all unchecked errors, both unassigned and those assigned to the blank identifier. Every returned error is now handled in some manner. These include: - Logging errors that would otherwise be missed - Returning errors to the caller for further processing - Checking error values to determine what to do next - Panicking for truely exceptional "impossible" errors On the subject of panics, they are a sharp tool and should be used sparingly. That being said, I have added them to check errors that were previously explicitly ignored, because they were expected to always return without failure. This could be due to fake error paths (i.e. writing to a bytes.Buffer panics for OOM and should never return an error) or previous logic asserts that an error case is impossible. Rather than leaving these unhandled and letting code fail later, either with incorrect results or a nil pointer dereference, it now produces a stack trace at the error emit site, which I find far more useful when debugging. While here, a bunch of dead code was removed, including code to move pre-0.1.1 uxto and transaction history account files to the new directory (as they would be unreadable anyways) and a big chunk of commented out rpcclient code. |
||
---|---|---|
.. | ||
doc.go | ||
fixedIO_test.go | ||
json.go | ||
serialization.go | ||
tx.go | ||
tx_test.go |