go get github.com/xeonx/timeago
You can see the docs page here
package main
import (
"time"
"github.com/xeonx/timeago"
)
func main() {
t := time.Now().Add(42 * time.Second)
// 's' will contain "less than a minute ago"
s := timeago.English.Format(t)
//...
}
go test
is used for testing.