Stop truncating microsecond everywhere with a util package
Created by: unknwon
Currently, we have many places that do .Truncate(time.Microsecond)
that truncates the microsecond part of a timestamp because Postgres 9.6 does not support saving microsecond. Tests would fail if we don't truncate and compare time values between Go and what's read from DB.
We should have a timeutil
or clock
package as a wrapper to take care of this.
Context: https://github.com/sourcegraph/sourcegraph/pull/11136/files#r433723412