💡 Improve go doc comments with internal links
This commit is contained in:
parent
cdf12a767c
commit
c5a9f09166
8 changed files with 38 additions and 34 deletions
10
gen_ts.go
10
gen_ts.go
|
|
@ -2,10 +2,10 @@ package nomino
|
|||
|
||||
import "time"
|
||||
|
||||
// FileTimestamp is the default format for WithTimestamp and WithTime.
|
||||
// FileTimestamp is the default format for [Timestamp].
|
||||
const FileTimestamp string = "2006-01-02T15-04-05-0700"
|
||||
|
||||
// FileTimestampNoTZ is the default format for WithTimestampUTC and WithTimeUTC.
|
||||
// FileTimestampNoTZ is the default format when using the [TimestampUTC] [TimestampOption].
|
||||
const FileTimestampNoTZ string = "2006-01-02T15-04-05"
|
||||
|
||||
type timestampConf struct {
|
||||
|
|
@ -14,7 +14,7 @@ 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.
|
||||
|
|
@ -35,7 +35,7 @@ func Timestamp(opts ...TimestampOption) Generator {
|
|||
}
|
||||
|
||||
// TimestampFormat sets the format for the generated name.
|
||||
// Consult time.Time.Format for details on the format.
|
||||
// Consult [time.Time.Format] for details on the format.
|
||||
func TimestampFormat(format string) TimestampOption {
|
||||
return func(c *timestampConf) {
|
||||
c.format = format
|
||||
|
|
@ -43,7 +43,7 @@ func TimestampFormat(format string) TimestampOption {
|
|||
}
|
||||
|
||||
// TimestampTime sets the time for the generated name.
|
||||
// By default, it uses the current time.
|
||||
// By default, [Timestamp] uses the current time.
|
||||
func TimestampTime(t time.Time) TimestampOption {
|
||||
return func(c *timestampConf) {
|
||||
c.ts = t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue