When you call
Encode(msg), you are not sending UTF-8 plain text.
To send plain text:
conn.Write(byte(msg)) // suppose msg is string
I am using gob.NewEncoder to encode string message msg but need to do it in utf-8.
I am getting warning in Ruby receiver (Logstash) saying that Received an event that has a different character encoding than you configured ...:expected_charset=>"UTF-8"