Package types provides various common types.
- func NewOnceCloser(c io.Closer) io.Closer
- type ByTime
- type CloseFunc
- type Time3339
EmptyBody is a ReadCloser that returns EOF on Read and does nothing on Close.
NopCloser is an io.Closer that does nothing.
ByTime sorts times.
type CloseFunc func() error
CloseFunc implements io.Closer with a function.
Time3339 is a time.Time which encodes to and from JSON as an RFC 3339 time in UTC.
func ParseTime3339OrZero ¶
ParseTime3339OrZero parses a string in RFC3339 format. If it's invalid, the zero time value is returned instead.
IsAnyZero returns whether the time is Go zero or Unix zero.
Time returns the time as a time.Time with slightly less stutter than a manual conversion.