From 4b1c08a139e64ff8d2a61a5a1511d66b36d8df08 Mon Sep 17 00:00:00 2001 From: Jim Ma Date: Sun, 27 Aug 2017 13:25:45 +0800 Subject: [PATCH] fix travis build for go 1.9 --- .travis.yml | 2 +- conn.go | 4 ++-- meta.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88b783f..b0991c5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - 1.8 + - 1.9 - tip matrix: diff --git a/conn.go b/conn.go index 97a4931..77e0ef2 100644 --- a/conn.go +++ b/conn.go @@ -26,7 +26,7 @@ func NewCCID(clientID ClientID, connID uint32) (cc CCID) { // ClientID return client id func (cc CCID) ClientID() ClientID { - return ClientID(uint32(cc >> 32)) + return uint32(cc >> 32) } // ConnID return connection id @@ -71,7 +71,7 @@ func NewConnManager() *ConnManager { d := make([]byte, 4) rand.Read(d) - clientID := ClientID(binary.LittleEndian.Uint32(d)) + clientID := binary.LittleEndian.Uint32(d) return &ConnManager{ clientID: clientID, diff --git a/meta.go b/meta.go index 07a0ce0..b737103 100644 --- a/meta.go +++ b/meta.go @@ -246,7 +246,7 @@ func EmbedClientIDHeaderToPayload(gf *GotaFrame) { } func ParseClientIDHeaderFromPayload(gf *GotaFrame) { - client := ClientID(binary.LittleEndian.Uint32(gf.Payload[:4])) + client := binary.LittleEndian.Uint32(gf.Payload[:4]) gf.Payload = gf.Payload[4:] gf.Length -= 4