go vet ./...
reported some warnings, mainly that we were passing API
around by value (and therefore copying a RWLock
). We weren't using the
RWLock in any of the functions that accepted API
by value, but it is
more correct none-the-less to not copy the data around. We were,
however, passing API by value into a function that modified the token
store, but that is a pointer type so it worked. All methods of API
now
take a pointer receiver.
We were also constructing composite literals (i.e., structs) without
naming the fields. We now avoid this everywhere.