Ejemplo n.º 1
0
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)
	}
}
Ejemplo n.º 2
0
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, &timestamp)
		t = message.TimestampToTime(timestamp)
	}

	return
}