go.crypto: remove unreachable code.
I ran go vet over all of go.crypto and removed lots of panic("unreachable") that are no longer needed.
R=golang-dev, r, dgryski
CC=golang-dev
https://golang.org/cl/10113043
This commit is contained in:
@@ -340,8 +340,6 @@ func (c *serverChan) read(data []byte) (n int, err error, windowAdjustment uint3
|
||||
|
||||
c.cond.Wait()
|
||||
}
|
||||
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// getWindowSpace takes, at most, max bytes of space from the peer's window. It
|
||||
|
||||
@@ -286,7 +286,6 @@ func (p *publickeyAuth) confirmKeyAck(key interface{}, t *transport) (bool, erro
|
||||
return false, UnexpectedMessageError{msgUserAuthSuccess, packet[0]}
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
func (p *publickeyAuth) method() string {
|
||||
@@ -325,7 +324,6 @@ func handleAuthResponse(t *transport) (bool, []string, error) {
|
||||
return false, nil, UnexpectedMessageError{msgUserAuthSuccess, packet[0]}
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// ClientAuthKeyring returns a ClientAuth using public key authentication via
|
||||
|
||||
@@ -730,8 +730,6 @@ func (s *ServerConn) Accept() (Channel, error) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// A Listener implements a network listener (net.Listener) for SSH connections.
|
||||
|
||||
@@ -77,5 +77,4 @@ func (ss *ServerTerminal) ReadLine() (line string, err error) {
|
||||
ss.Channel.AckRequest(ok)
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ func dial(handler serverType, t *testing.T) *ClientConn {
|
||||
handler(ch.(*serverChan), t)
|
||||
}()
|
||||
}
|
||||
<-done
|
||||
}()
|
||||
|
||||
config := &ClientConfig{
|
||||
|
||||
@@ -139,7 +139,6 @@ func (t *transport) readPacket() ([]byte, error) {
|
||||
return packet, nil
|
||||
}
|
||||
}
|
||||
panic("unreachable")
|
||||
}
|
||||
|
||||
// Encrypt and send a packet of data to the remote peer.
|
||||
|
||||
Reference in New Issue
Block a user