Package logrot implements a log file writer with rotation and gzip compression. The rotation and compression are handled as needed during write operations.
Documentation at https://godoc.org/xi2.org/x/logrot.
Download and install with go get xi2.org/x/logrot.