mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
rafthttp: fix "unconvert" warnings
Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
This commit is contained in:
parent
eae30a6c9b
commit
53ade5e872
@ -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
|
||||
|
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
x
Reference in New Issue
Block a user