Github wiki pages publicly editable

100 views
Skip to first unread message

Ivan Borshukov

unread,
Dec 14, 2017, 11:04:53 AM12/14/17
to golang-nuts
Hello,

I've noticed that I'm able to edit the wiki pages on https://github.com/golang/go/wiki and I wonder whether this is intentional.

Cheers,
Ivan

Jan Mercl

unread,
Dec 14, 2017, 11:07:32 AM12/14/17
to Ivan Borshukov, golang-nuts
On Thu, Dec 14, 2017 at 5:05 PM Ivan Borshukov <bo0m...@gmail.com> wrote:

> I've noticed that I'm able to edit the wiki pages on https://github.com/golang/go/wiki and I wonder whether this is intentional.

IINM, it's like that from the beginning of the Github repository, so probably intentional.

--

-j

Ivan Borshukov

unread,
Dec 15, 2017, 1:00:13 AM12/15/17
to golan...@googlegroups.com
Forwarding to the mailing list this time.

Cheers.

On Dec 14, 2017 18:14, "Ivan Borshukov" <bo0m...@gmail.com> wrote:
Ok, thanks.

If so, I want to announce the change that I've maid. It is regarding the rate limiting section [0].

The wiki page states that when the created ticker is Stop-ed, the created goroutine will exit,
which I think is not true, since the Ticker.Stop's documentation[1] states that Stop does not
result in Ticker.C being closed. A minimal example confirms my understanding and results
in a panic due to deadlock.

```go
package main

import (
"sync"
"time"
)

func main() {
tick := time.NewTicker(time.Second)
throttle := make(chan time.Time, 1)

wg := sync.WaitGroup{}
wg.Add(1)
go func() {
defer wg.Done()
for t := range tick.C {
select {
case throttle <- t:
default:
}
} // Wiki page says: exits after tick.Stop()
}()

tick.Stop()
wg.Wait()
}
```

The above code in the playground: https://play.golang.org/p/oWrcCa25ki.

The diff can be viewed at [2].



Cheers,
Ivan
--
Ivan Borshukov, bo0m...@gmail.com

Reply all
Reply to author
Forward
0 new messages