_, error := connection.Read(buffer)
buffer := make([]byte, BUFFER_SIZE)
splited := strings.Split(string(buffer), " ")
switch splited[0] {
case "TEST":
connection.Write([]byte("TEST CONNECTION OK"))
log.Printf("TEST COMMAND")
break;
如果我在客户端写“TEST”,服务器不会进入case语句。但是如果我从客户端发送“TEST SOMETHING”,服务器将按预期输入它。这是go-lang的bug吗?
相关分类