🚨 A bunch of small improvements from linter
This commit is contained in:
parent
480e36763f
commit
8f02956ecd
10 changed files with 51 additions and 47 deletions
|
|
@ -2,10 +2,10 @@ package nomino
|
|||
|
||||
import "time"
|
||||
|
||||
// FileTimestamp is the default format for WithTimestamp and WithTime
|
||||
// FileTimestamp is the default format for WithTimestamp and WithTime.
|
||||
const FileTimestamp string = "2006-01-02T15-04-05-0700"
|
||||
|
||||
// FileTimestampNoTZ is the default format for WithTimestampUTC and WithTimeUTC
|
||||
// FileTimestampNoTZ is the default format for WithTimestampUTC and WithTimeUTC.
|
||||
const FileTimestampNoTZ string = "2006-01-02T15-04-05"
|
||||
|
||||
type timestampConf struct {
|
||||
|
|
@ -14,11 +14,11 @@ type timestampConf struct {
|
|||
utc bool
|
||||
}
|
||||
|
||||
// TimestampOption provides options for the Timestamp Generator
|
||||
// TimestampOption provides options for the Timestamp Generator.
|
||||
type TimestampOption func(c *timestampConf)
|
||||
|
||||
// Timestamp generates a a date and time. By default, it uses the current time, and will.
|
||||
// be formatted accourding to FileTimestamp
|
||||
// be formatted accourding to FileTimestamp.
|
||||
func Timestamp(opts ...TimestampOption) Generator {
|
||||
c := timestampConf{format: FileTimestamp, ts: time.Now()}
|
||||
for _, opt := range opts {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue