]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/tls: add Error method to alert
authorRuss Cox <rsc@golang.org>
Fri, 28 Oct 2011 02:42:32 +0000 (19:42 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 28 Oct 2011 02:42:32 +0000 (19:42 -0700)
alerts get used as both values and errors.
Rather than introduce an alertError wrapper,
this CL just adds an Error method, which will
satisfy the error interface when the time comes.

R=agl, bradfitz
CC=golang-dev
https://golang.org/cl/5294073

src/pkg/crypto/tls/alert.go

index 3b9e0e2415b2afd22e9b52c2186fc4d51d6605f9..0856311e4cba288461c0f83ba9d5c18ba99610fa 100644 (file)
@@ -71,3 +71,7 @@ func (e alert) String() string {
        }
        return "alert(" + strconv.Itoa(int(e)) + ")"
 }
+
+func (e alert) Error() string {
+       return e.String()
+}