Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(849)

Unified Diff: cert/cert_test.go

Issue 70770043: all: use errgo instead of fmt.Errorf
Patch Set: all: use errgo instead of fmt.Errorf Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cert/cert.go ('k') | charm/bundle.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cert/cert_test.go
=== modified file 'cert/cert_test.go'
--- cert/cert_test.go 2014-02-21 10:13:05 +0000
+++ cert/cert_test.go 2014-03-03 12:02:05 +0000
@@ -8,7 +8,6 @@
"crypto/rsa"
"crypto/tls"
"crypto/x509"
- "fmt"
"io"
"io/ioutil"
"net"
@@ -16,6 +15,7 @@
"testing"
"time"
+ "github.com/juju/errgo/errors"
gc "launchpad.net/gocheck"
"launchpad.net/juju-core/cert"
@@ -210,7 +210,7 @@
_, err := clientConn.Write([]byte(msg))
if err != nil {
- done <- fmt.Errorf("client: %v", err)
+ done <- errors.Notef(err, "client")
}
clientState = clientConn.ConnectionState()
done <- nil
@@ -224,11 +224,11 @@
defer serverConn.Close()
data, err := ioutil.ReadAll(serverConn)
if err != nil {
- done <- fmt.Errorf("server: %v", err)
+ done <- errors.Notef(err, "server")
return
}
if string(data) != msg {
- done <- fmt.Errorf("server: got %q; expected %q", data, msg)
+ done <- errors.Newf("server: got %q; expected %q", data, msg)
return
}
« no previous file with comments | « cert/cert.go ('k') | charm/bundle.go » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b