rafthttp: fix "unconvert" warnings

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
release-3.4
Gyuho Lee 2018-04-30 14:03:33 -07:00
parent eae30a6c9b
commit 53ade5e872
3 changed files with 7 additions and 7 deletions

View File

@ -86,12 +86,12 @@ func (enc *msgAppV2Encoder) encode(m *raftpb.Message) error {
start := time.Now()
switch {
case isLinkHeartbeatMessage(m):
enc.uint8buf[0] = byte(msgTypeLinkHeartbeat)
enc.uint8buf[0] = msgTypeLinkHeartbeat
if _, err := enc.w.Write(enc.uint8buf); err != nil {
return err
}
case enc.index == m.Index && enc.term == m.LogTerm && m.LogTerm == m.Term:
enc.uint8buf[0] = byte(msgTypeAppEntries)
enc.uint8buf[0] = msgTypeAppEntries
if _, err := enc.w.Write(enc.uint8buf); err != nil {
return err
}
@ -179,7 +179,7 @@ func (dec *msgAppV2Decoder) decode() (raftpb.Message, error) {
if _, err := io.ReadFull(dec.r, dec.uint8buf); err != nil {
return m, err
}
typ = uint8(dec.uint8buf[0])
typ = dec.uint8buf[0]
switch typ {
case msgTypeLinkHeartbeat:
return linkHeartbeatMessage, nil

View File

@ -256,7 +256,7 @@ func (p *peer) send(m raftpb.Message) {
zap.String("message-type", m.Type.String()),
zap.String("local-member-id", p.localID.String()),
zap.String("from", types.ID(m.From).String()),
zap.String("remote-peer-id", types.ID(p.id).String()),
zap.String("remote-peer-id", p.id.String()),
zap.Bool("remote-peer-active", p.status.isActive()),
)
} else {
@ -269,7 +269,7 @@ func (p *peer) send(m raftpb.Message) {
zap.String("message-type", m.Type.String()),
zap.String("local-member-id", p.localID.String()),
zap.String("from", types.ID(m.From).String()),
zap.String("remote-peer-id", types.ID(p.id).String()),
zap.String("remote-peer-id", p.id.String()),
zap.Bool("remote-peer-active", p.status.isActive()),
)
} else {

View File

@ -62,7 +62,7 @@ func (g *remote) send(m raftpb.Message) {
zap.String("message-type", m.Type.String()),
zap.String("local-member-id", g.localID.String()),
zap.String("from", types.ID(m.From).String()),
zap.String("remote-peer-id", types.ID(g.id).String()),
zap.String("remote-peer-id", g.id.String()),
zap.Bool("remote-peer-active", g.status.isActive()),
)
} else {
@ -75,7 +75,7 @@ func (g *remote) send(m raftpb.Message) {
zap.String("message-type", m.Type.String()),
zap.String("local-member-id", g.localID.String()),
zap.String("from", types.ID(m.From).String()),
zap.String("remote-peer-id", types.ID(g.id).String()),
zap.String("remote-peer-id", g.id.String()),
zap.Bool("remote-peer-active", g.status.isActive()),
)
} else {