Skip to content

Commit 890cb9e

Browse files
committed
fix(binder): MustUnixTime docs say time.Time, not time.Duration
The non-Must variants (UnixTime, UnixTimeMilli, UnixTimeNano) all say "binds parameter to time.Time variable", but the three Must* versions copy-pasted the Duration variant's docstring and say time.Duration. The function signature on each takes *time.Time. Also dropped the stray double space and fixed "nano second" -> "nanosecond" on the Nano one while in there. Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
1 parent c08ea0f commit 890cb9e

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

binder.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ func (b *ValueBinder) UnixTime(sourceParam string, dest *time.Time) *ValueBinder
12391239
return b.unixTime(sourceParam, dest, false, time.Second)
12401240
}
12411241

1242-
// MustUnixTime requires parameter value to exist to bind to time.Duration variable (in local time corresponding
1242+
// MustUnixTime requires parameter value to exist to bind to time.Time variable (in local time corresponding
12431243
// to the given Unix time). Returns error when value does not exist.
12441244
//
12451245
// Example: 1609180603 bind to 2020-12-28T18:36:43.000000000+00:00
@@ -1260,7 +1260,7 @@ func (b *ValueBinder) UnixTimeMilli(sourceParam string, dest *time.Time) *ValueB
12601260
return b.unixTime(sourceParam, dest, false, time.Millisecond)
12611261
}
12621262

1263-
// MustUnixTimeMilli requires parameter value to exist to bind to time.Duration variable (in local time corresponding
1263+
// MustUnixTimeMilli requires parameter value to exist to bind to time.Time variable (in local time corresponding
12641264
// to the given Unix time in millisecond precision). Returns error when value does not exist.
12651265
//
12661266
// Example: 1647184410140 bind to 2022-03-13T15:13:30.140000000+00:00
@@ -1284,8 +1284,8 @@ func (b *ValueBinder) UnixTimeNano(sourceParam string, dest *time.Time) *ValueBi
12841284
return b.unixTime(sourceParam, dest, false, time.Nanosecond)
12851285
}
12861286

1287-
// MustUnixTimeNano requires parameter value to exist to bind to time.Duration variable (in local Time corresponding
1288-
// to the given Unix time value in nano second precision). Returns error when value does not exist.
1287+
// MustUnixTimeNano requires parameter value to exist to bind to time.Time variable (in local time corresponding
1288+
// to the given Unix time value in nanosecond precision). Returns error when value does not exist.
12891289
//
12901290
// Example: 1609180603123456789 binds to 2020-12-28T18:36:43.123456789+00:00
12911291
// Example: 1000000000 binds to 1970-01-01T00:00:01.000000000+00:00

0 commit comments

Comments
 (0)