Skip to content

Commit

Permalink
chore: Fix linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
yarlson committed Sep 24, 2023
1 parent e277ac8 commit d8ca059
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions example/websockets/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,10 @@ func handleConnection(w http.ResponseWriter, r *http.Request) {
ticker := time.NewTicker(1 * time.Second)
defer ticker.Stop()

for {
select {
case t := <-ticker.C:
message := fmt.Sprintf("Message sent at %s", t)
if err := conn.WriteMessage(websocket.TextMessage, []byte(message)); err != nil {
return
}
for t := range ticker.C {
message := fmt.Sprintf("Message sent at %s", t)
if err := conn.WriteMessage(websocket.TextMessage, []byte(message)); err != nil {
return
}
}
}
Expand Down

0 comments on commit d8ca059

Please sign in to comment.