Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on A fast geo database with LevelDB, Go and Geohashes.
Now().UnixNano() is not guaranteed to be monotonically increasing. I'd be more careful if your keys really do need to be unique.
You can use time.Truncate to get the 10 minute interval.
var t time.Time t = start for { if t.After(stop) { break } /* ... */ t = t.Add(d) }
for t := start; !t.After(stop); t = t.Add(d) {
Now().UnixNano() is not guaranteed to be monotonically increasing. I'd be more careful if your keys really do need to be unique.
You can use time.Truncate to get the 10 minute interval.
Would usually be written: