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;
If I write "TEST" in client, the server will not enter the case statement. But if I send "TEST SOMETHING" from client, the server will enter the case as expected. Is this a bug of go-lang?
I printed splited[0]+"aaa" and it's just "TESTaaa", nothing seems wrong. Also tested with if splited[0] == "TEST", all failed
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.