mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-09 08:01:31 +00:00
tstime: fix ParseDuration for '6' digit (#6363)
The cutset provided to strings.TrimRight was missing the digit '6', making it such that we couldn't parse something like "365d". Signed-off-by: Joe Tsai <joetsai@digital-static.net>
This commit is contained in:
@@ -109,6 +109,10 @@ func TestParseDuration(t *testing.T) {
|
||||
}{
|
||||
{"1h", time.Hour},
|
||||
{"1d", 24 * time.Hour},
|
||||
{"365d", 365 * 24 * time.Hour},
|
||||
{"12345d", 12345 * 24 * time.Hour},
|
||||
{"67890d", 67890 * 24 * time.Hour},
|
||||
{"100d", 100 * 24 * time.Hour},
|
||||
{"1d1d", 48 * time.Hour},
|
||||
{"1h1d", 25 * time.Hour},
|
||||
{"1d1h", 25 * time.Hour},
|
||||
|
Reference in New Issue
Block a user