go.crypto/ssh: add String method to RejectionReason.

R=agl, dave
CC=golang-dev
https://golang.org/cl/14494055
This commit is contained in:
Han-Wen Nienhuys
2013-10-14 16:13:09 -04:00
committed by Adam Langley
parent 7dc9a79b3e
commit 4a7557f2bd
+15
View File
@@ -77,6 +77,21 @@ const (
ResourceShortage
)
// String converts the rejection reason to human readable form.
func (r RejectionReason) String() string {
switch r {
case Prohibited:
return "administratively prohibited"
case ConnectionFailed:
return "connect failed"
case UnknownChannelType:
return "unknown channel type"
case ResourceShortage:
return "resource shortage"
}
return fmt.Sprintf("unknown reason %d", int(r))
}
type channel struct {
packetConn // the underlying transport
localId, remoteId uint32