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.
@@ -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()
