You are doing the common mistake of having unexported fields in your struct.
The encoding/json
package states (my emphasis):
Struct values encode as JSON objects. Each exported struct field becomes a member of the object unless
- the field's tag is "-", or
- the field is empty and its tag specifies the "omitempty" option.
This is due to Go not allowing reflection on unexported fields.
It should work if you change your struct to the following:
type HandleConnection struct {
Session string `json:"session"`
Passwd int `json:"field1"`
Salon string `json:"fied2"`
Color string `json:"field3"`
State float64 `json:"field4"`
Message string `json:"field5"`
}