func TestTimestampToTime(test *testing.T) { timestamp := message.Timestamp(807656789876568412) expected := time.Unix(807656789876, 568412000) t := message.TimestampToTime(timestamp) if t != expected { test.Error("Expected", expected, "but got", t) } }
func ReadLoginResponse(r io.Reader) (code message.LoginResponseCode, tick message.Tick, t time.Time) { Read(r, &code) if code == message.LoginResponseCodes["ok"] { Read(r, &tick) var timestamp message.Timestamp Read(r, ×tamp) t = message.TimestampToTime(timestamp) } return }