package client_test import ( "encoding/json" "fmt" "testing" "git.cheetah.cat/tetrapack/go-zello-client/client" ) func TestLoginMarshalling(t *testing.T) { var err error workLoginReq := client.ZelloLogonReq{ ZelloCommand: client.ZelloCommand{Command: "logon", Sequence: 1337}, Username: "username", Password: "password", Channels: []string{"chan1", "chan2"}, } workBytes, err := json.Marshal(workLoginReq) if err != nil { t.Fatal(err) } fmt.Println(string(workBytes)) consLoginReq := client.ZelloLogonReq{ ZelloCommand: client.ZelloCommand{Command: "logon", Sequence: 1337}, Username: "username", Password: "password", Channels: []string{"consumer-chan1"}, AuthToken: "authToken", } consBytes, err := json.Marshal(consLoginReq) if err != nil { t.Fatal(err) } fmt.Println(string(consBytes)) }