x/time/rate: add rate.Sometimes, which runs a function occasionally. Modeled after sync.Once; intended to provide simple throttling akin to the C++ log functions LOG_FIRST_N, LOG_EVERY_N, and LOG_EVERY_N_SEC. Originally authored by sameer@golang.org. Fixes golang/go#54237 Change-Id: I7c6266cc780eb6dad30d310485de492f790dbcdb Reviewed-on: https://go-review.googlesource.com/c/time/+/421915 Reviewed-by: Sameer Ajmani <sameer@golang.org>
This repository provides supplementary Go time packages.
The easiest way to install is to run go get -u golang.org/x/time. You can also manually git clone the repository to $GOPATH/src/golang.org/x/time.
This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.
The main issue tracker for the time repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/time:” in the subject line, so it is easy to find.