Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(3801)

Side by Side Diff: rpc/jsoncodec/conn.go

Issue 13606045: various: gocheck, checkers, imports fixes (Closed)
Patch Set: Created 11 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
OLDNEW
1 package jsoncodec 1 package jsoncodec
2 2
3 import ( 3 import (
4 "code.google.com/p/go.net/websocket"
5 "encoding/json" 4 "encoding/json"
6 "net" 5 "net"
6
7 "code.google.com/p/go.net/websocket"
7 ) 8 )
8 9
9 // NewWebsocket returns an rpc codec that uses the given websocket 10 // NewWebsocket returns an rpc codec that uses the given websocket
10 // connection to send and receive messages. 11 // connection to send and receive messages.
11 func NewWebsocket(conn *websocket.Conn) *Codec { 12 func NewWebsocket(conn *websocket.Conn) *Codec {
12 return New(wsJSONConn{conn}) 13 return New(wsJSONConn{conn})
13 } 14 }
14 15
15 type wsJSONConn struct { 16 type wsJSONConn struct {
16 conn *websocket.Conn 17 conn *websocket.Conn
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return conn.enc.Encode(msg) 49 return conn.enc.Encode(msg)
49 } 50 }
50 51
51 func (conn *netConn) Receive(msg interface{}) error { 52 func (conn *netConn) Receive(msg interface{}) error {
52 return conn.dec.Decode(msg) 53 return conn.dec.Decode(msg)
53 } 54 }
54 55
55 func (conn *netConn) Close() error { 56 func (conn *netConn) Close() error {
56 return conn.conn.Close() 57 return conn.conn.Close()
57 } 58 }
OLDNEW
« names/user.go ('K') | « rpc/jsoncodec/codec_test.go ('k') | state/api/agent/state.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b