more example in example

As this file is an example, it could help people to learn golang pattern. So, i've added another way to get a clock signal. I've kept the original to show people 2 different ways.

Former-commit-id: d5b50c0845e93388a41863fb262b166320c2735c
This commit is contained in:
Pierre PACI 2017-11-17 21:22:27 +01:00 committed by GitHub
parent 3b572eb23b
commit 8d0ba9a0d0

View File

@ -77,7 +77,7 @@ func main() {
go func() {
i := 0
for {
for range time.Tick(1*time.Second){ //another way to get clock signal
mutex.Lock()
broadcast(Conn, fmt.Sprintf("aaaa2 %d\n", i))
mutex.Unlock()