mirror of
https://github.com/raz-varren/sacrificial-socket.git
synced 2025-10-06 00:26:55 +08:00
I will be lint free!
This commit is contained in:
@@ -22,7 +22,8 @@ const ( // ASCII chars
|
|||||||
startOfHeaderByte uint8 = 1 //SOH
|
startOfHeaderByte uint8 = 1 //SOH
|
||||||
startOfDataByte = 2 //STX
|
startOfDataByte = 2 //STX
|
||||||
|
|
||||||
SupportedSubProtocol string = "sac-sock"
|
//The official sacrificial-socket sub protocol
|
||||||
|
SubProtocol string = "sac-sock"
|
||||||
)
|
)
|
||||||
|
|
||||||
type event struct {
|
type event struct {
|
||||||
@@ -194,7 +195,7 @@ func (serv *SocketServer) loop(ws *websocket.Conn) {
|
|||||||
|
|
||||||
func protocolSupported(conf *websocket.Config) bool {
|
func protocolSupported(conf *websocket.Config) bool {
|
||||||
for _, p := range conf.Protocol {
|
for _, p := range conf.Protocol {
|
||||||
if p == SupportedSubProtocol {
|
if p == SubProtocol {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -46,7 +46,7 @@ var (
|
|||||||
"#", ".",
|
"#", ".",
|
||||||
}
|
}
|
||||||
|
|
||||||
idCharLen int = len(idChars) - 1
|
idCharLen = len(idChars) - 1
|
||||||
)
|
)
|
||||||
|
|
||||||
func newSocket(serv *SocketServer, ws *websocket.Conn) *Socket {
|
func newSocket(serv *SocketServer, ws *websocket.Conn) *Socket {
|
||||||
@@ -89,7 +89,7 @@ func (s *Socket) GetRooms() []string {
|
|||||||
defer s.roomsl.RUnlock()
|
defer s.roomsl.RUnlock()
|
||||||
|
|
||||||
var roomList []string
|
var roomList []string
|
||||||
for room, _ := range s.rooms {
|
for room := range s.rooms {
|
||||||
roomList = append(roomList, room)
|
roomList = append(roomList, room)
|
||||||
}
|
}
|
||||||
return roomList
|
return roomList
|
||||||
|
Reference in New Issue
Block a user