Go: time: NewTicker is missing documentation on initial tick

Created on 28 Oct 2020  ·  1Comment  ·  Source: golang/go

What version of Go are you using (go version)?

1.15

What did you do?

I was about to use https://golang.org/pkg/time/#Tick and wanted to know if I would get an initial tick or the first tick will be sent immediately or after d time.Duration. https://golang.org/pkg/time/#Tick refers to https://golang.org/pkg/time/#NewTicker so I opened up the documentation for that. I noticed that https://golang.org/pkg/time/#NewTicker doesn't document whether the initial tick is sent immediately or after d time.Duration.

What did you expect to see?

That https://golang.org/pkg/time/#NewTicker documents this behaviour.

What did you see instead?

Behaviour wasn't documented.

Documentation NeedsFix

Most helpful comment

Change https://golang.org/cl/265818 mentions this issue: time: in NewTicker, document that the 1st tick comes after d

>All comments

Change https://golang.org/cl/265818 mentions this issue: time: in NewTicker, document that the 1st tick comes after d

Was this page helpful?
0 / 5 - 0 ratings