Another test change made an `err :=` fail because it's no longer
declaring a new variable, but another one needed the :. Or a patch
applied incorrectly. It is a mystery.
If we're renaming golangci-lint to linter (since it's now
our default linter), we no longer have a workflow named
golangci-lint, so we shouldn't be calling it or requiring
it from other workflows.
gometalinter is slow, golangci-lint is fast and checks a lot
more things, let's just use that. We leave the old targets in
the Makefile for now so we can use them for sanity-checking
the results.
The anonymous goroutine, if it gets an error, can race with other
changes. Make the values we intend to call it on parameters so it will
work with those even if other things are happening.
The attempt to fix up the logic broke returns from loadNodeID()
in some cases, because it was overwriting the node ID generated
in the IsNotExist case.
json.Decoder.Decode() can yield io.EOF which is not actually an
error. This appears to have caused a number of indirect test failures
by making ImportRoaring generally report failure.
This is more lint fixes, but it's less obvious to me what the
right handling for errors is, or whether disregarding them is
safe, so it's a separate commit.
So with the switch to a new linter, we get a lot of new warnings,
and the majority of them are harmless probably, but a few might be
real. Variously just use _ to suppress warnings, or report errors.
There's probably things here that deserve better fixes, but we can
always revisit it.
There's two kinds of unchecked errors here. Writes to a hash
(we don't care, hash functions usually don't error in ways we
care about), and rollbacks of non-writing transactions to a
database. After studying the boltdb docs, I concluded that
the recommended solution is to use the `.View(...)` function
instead of directly controlling the transaction, so I switched
the functions to do that.
golangci-lint is actually dependent on a specific not-quite
most recent version of golang.org/x/tools, fixing the dependency
is hard and requires changing one of the upstream packages,
just omitting the `-u` lets golangci-lint grab the version it
wants and use that.