[lxc-devel] [lxd/master] relax constraints on WebsocketRecvStream args

tych0 on Github lxc-bot at linuxcontainers.org
Thu Aug 4 21:59:33 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 452 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160804/17125fdb/attachment.bin>
-------------- next part --------------
From 682d9fba03a7967b6c3048de93530f9d766699a9 Mon Sep 17 00:00:00 2001
From: Tycho Andersen <tycho.andersen at canonical.com>
Date: Thu, 4 Aug 2016 21:58:53 +0000
Subject: [PATCH] relax constraints on WebsocketRecvStream args

We don't use the Close method any more, so let's make these Writers, not
WriteClosers.

Signed-off-by: Tycho Andersen <tycho.andersen at canonical.com>
---
 shared/network.go | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/shared/network.go b/shared/network.go
index 7032348..8689880 100644
--- a/shared/network.go
+++ b/shared/network.go
@@ -180,10 +180,10 @@ func WebsocketSendStream(conn *websocket.Conn, r io.Reader, bufferSize int) chan
 	return ch
 }
 
-func WebsocketRecvStream(w io.WriteCloser, conn *websocket.Conn) chan bool {
+func WebsocketRecvStream(w io.Writer, conn *websocket.Conn) chan bool {
 	ch := make(chan bool)
 
-	go func(w io.WriteCloser, conn *websocket.Conn) {
+	go func(w io.Writer, conn *websocket.Conn) {
 		for {
 			mt, r, err := conn.NextReader()
 			if mt == websocket.CloseMessage {


More information about the lxc-devel mailing list