Skip to content

Commit

Permalink
Fix test TestServer
Browse files Browse the repository at this point in the history
* typo in comments
* loop variable captured in function literal

See https://golang.org/doc/faq#closures_and_goroutines
  • Loading branch information
tc-hib committed Dec 5, 2020
1 parent 3f4c5ef commit 12e30b1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sse_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"
"sync"
"testing"
"time"
)

func TestNewServerNilOptions(t *testing.T) {
Expand Down Expand Up @@ -44,7 +45,7 @@ func TestServer(t *testing.T) {

defer srv.Shutdown()

// Create N channes
// Create N channels
for n := 0; n < channelCount; n++ {
name := fmt.Sprintf("CH-%d", n+1)
srv.addChannel(name)
Expand All @@ -54,7 +55,7 @@ func TestServer(t *testing.T) {
wg := sync.WaitGroup{}
m := sync.Mutex{}

// Create N clients in all channes
// Create N clients in all channels
for n := 0; n < clientCount; n++ {
for name, ch := range srv.channels {
wg.Add(1)
Expand Down

0 comments on commit 12e30b1

Please sign in to comment.