Remove unneded else statements to follow Golang coding standards

This commit is contained in:
Ola Bini 2019-12-21 23:13:41 +00:00
parent 6bf58a9f58
commit c2b5fd9e9d
No known key found for this signature in database
GPG key ID: 6786A150F6A2B28F
2 changed files with 14 additions and 16 deletions

View file

@ -492,7 +492,7 @@ func (server *Server) handleAuthenticate(client *Client, msg *Message) {
if auth.Password == nil {
client.RejectAuth(mumbleproto.Reject_WrongUserPW, "")
return
} else {
}
if server.CheckSuperUserPassword(*auth.Password) {
ok := false
client.user, ok = server.UserNameMap[client.Username]
@ -504,7 +504,6 @@ func (server *Server) handleAuthenticate(client *Client, msg *Message) {
client.RejectAuth(mumbleproto.Reject_WrongUserPW, "")
return
}
}
} else {
// First look up registration by name.
user, exists := server.UserNameMap[client.Username]
@ -1037,9 +1036,8 @@ func (server *Server) handleUDPPacket(udpaddr *net.UDPAddr, buf []byte) {
client.Debugf("unable to decrypt incoming packet, requesting resync: %v", err)
client.cryptResync()
return
} else {
match = client
}
match = client
}
if match != nil {
match.udpaddr = udpaddr

View file

@ -59,9 +59,9 @@ func (pds *PacketData) next() (ret uint64) {
ret = uint64(pds.Buf[pds.offset])
pds.offset++
return
} else {
pds.ok = false
}
pds.ok = false
return 0
}
@ -71,9 +71,9 @@ func (pds *PacketData) Next8() (ret uint8) {
ret = uint8(pds.Buf[pds.offset])
pds.offset++
return
} else {
pds.ok = false
}
pds.ok = false
return 0
}