mirror of
https://github.com/EchoVault/SugarDB.git
synced 2025-10-22 07:29:39 +08:00
Code formatting: declare writer and reader on the same line
This commit is contained in:
@@ -40,8 +40,7 @@ func (cg *ConsumerGroup) SendMessage(message string) {
|
||||
|
||||
cg.subscribersRWMut.RUnlock()
|
||||
|
||||
w := io.Writer(*conn)
|
||||
r := io.Reader(*conn)
|
||||
w, r := io.Writer(*conn), io.Reader(*conn)
|
||||
|
||||
if _, err := w.Write([]byte(fmt.Sprintf("$%d\r\n%s\r\n\n", len(message), message))); err != nil {
|
||||
// TODO: Log error at configured logger
|
||||
@@ -168,8 +167,7 @@ func (ch *Channel) Start() {
|
||||
|
||||
for _, conn := range ch.subscribers {
|
||||
go func(conn *net.Conn) {
|
||||
w := io.Writer(*conn)
|
||||
r := io.Reader(*conn)
|
||||
w, r := io.Writer(*conn), io.Reader(*conn)
|
||||
|
||||
if _, err := w.Write([]byte(fmt.Sprintf("$%d\r\n%s\r\n\r\n", len(message), message))); err != nil {
|
||||
// TODO: Log error at configured logger
|
||||
|
@@ -84,8 +84,7 @@ func (server *Server) StartTCP(ctx context.Context) {
|
||||
func (server *Server) handleConnection(ctx context.Context, conn net.Conn) {
|
||||
server.ACL.RegisterConnection(&conn)
|
||||
|
||||
w := io.Writer(conn)
|
||||
r := io.Reader(conn)
|
||||
w, r := io.Writer(conn), io.Reader(conn)
|
||||
|
||||
cid := server.ConnID.Add(1)
|
||||
ctx = context.WithValue(ctx, utils.ContextConnID("ConnectionID"),
|
||||
|
Reference in New Issue
Block a user