Skip to content

Commit

Permalink
gofmt -s to simplify some code
Browse files Browse the repository at this point in the history
  • Loading branch information
rsms committed Sep 14, 2020
1 parent b1b27bf commit 6293262
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion examples/websocket-chat/server.go
Expand Up @@ -68,7 +68,7 @@ func onAccept(s *gotalk.Sock) {
func broadcast(name string, in interface{}) {
socksmu.RLock()
defer socksmu.RUnlock()
for s, _ := range socks {
for s := range socks {
s.Notify(name, in)
}
}
Expand Down
20 changes: 10 additions & 10 deletions protocol_test.go
Expand Up @@ -115,16 +115,16 @@ func TestWriteReadMsg(t *testing.T) {
assertReadMsg(t, s, &testMsg{MsgTypeNotification, "", "a", 0, 0})

m := []*testMsg{
&testMsg{MsgTypeSingleReq, "abcd", "echo", 0, 0},
&testMsg{MsgTypeSingleReq, "zzzz", "lolcats", 0, 3},
&testMsg{MsgTypeStreamReq, "abcd", "echo", 0, 4},
&testMsg{MsgTypeStreamReqPart, "abcd", "", 0, 5},
&testMsg{MsgTypeSingleRes, "abcd", "", 0, 6},
&testMsg{MsgTypeStreamRes, "abcd", "", 0, 7},
&testMsg{MsgTypeErrorRes, "abcd", "", 0, 8},
&testMsg{MsgTypeRetryRes, "abcd", "", 6, 8},
&testMsg{MsgTypeNotification, "", "hello", 0, 9},
&testMsg{MsgTypeProtocolError, "", "", 0, int(ProtocolErrorInvalidMsg)},
{MsgTypeSingleReq, "abcd", "echo", 0, 0},
{MsgTypeSingleReq, "zzzz", "lolcats", 0, 3},
{MsgTypeStreamReq, "abcd", "echo", 0, 4},
{MsgTypeStreamReqPart, "abcd", "", 0, 5},
{MsgTypeSingleRes, "abcd", "", 0, 6},
{MsgTypeStreamRes, "abcd", "", 0, 7},
{MsgTypeErrorRes, "abcd", "", 0, 8},
{MsgTypeRetryRes, "abcd", "", 6, 8},
{MsgTypeNotification, "", "hello", 0, 9},
{MsgTypeProtocolError, "", "", 0, int(ProtocolErrorInvalidMsg)},
}

// Serially (read, write, read, write, ...)
Expand Down

0 comments on commit 6293262

Please sign in to comment.