aboutsummaryrefslogtreecommitdiff
path: root/syncapi/sync
diff options
context:
space:
mode:
authorAbhinav Krishna C K <abbyck@users.noreply.github.com>2020-03-18 18:18:51 +0530
committerGitHub <noreply@github.com>2020-03-18 12:48:51 +0000
commitec38783192dd551718902719c8446c6cc3942dfa (patch)
treef6b74fb647007286298abd9ea7664a293b9fcbc9 /syncapi/sync
parentc019ad708669a4c269072bea933f0a520a78ca7c (diff)
maintenance: Fix matrix-org#896 use %w format verb to wrap errors (#916)
* maintenance: Fix matrix-org#896 use %w format verb to wrap errors * In Go version 1.13 a new formatting verb introduced for fmt.Errorf %w https://blog.golang.org/go1.13-errors * update %s to %w to wrap errors. * Update all instances of error type to use %w Signed-off-by: Abhinav Krishna C K <me@abhy.me> Co-authored-by: Kegsay <kegan@matrix.org>
Diffstat (limited to 'syncapi/sync')
-rw-r--r--syncapi/sync/notifier_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/syncapi/sync/notifier_test.go b/syncapi/sync/notifier_test.go
index 02da0f7e..350f8559 100644
--- a/syncapi/sync/notifier_test.go
+++ b/syncapi/sync/notifier_test.go
@@ -135,7 +135,7 @@ func TestNewEventAndJoinedToRoom(t *testing.T) {
go func() {
pos, err := waitForEvents(n, newTestSyncRequest(bob, syncPositionBefore))
if err != nil {
- t.Errorf("TestNewEventAndJoinedToRoom error: %s", err)
+ t.Errorf("TestNewEventAndJoinedToRoom error: %w", err)
}
if pos != syncPositionAfter {
t.Errorf("TestNewEventAndJoinedToRoom want %v, got %v", syncPositionAfter, pos)
@@ -163,7 +163,7 @@ func TestNewInviteEventForUser(t *testing.T) {
go func() {
pos, err := waitForEvents(n, newTestSyncRequest(bob, syncPositionBefore))
if err != nil {
- t.Errorf("TestNewInviteEventForUser error: %s", err)
+ t.Errorf("TestNewInviteEventForUser error: %w", err)
}
if pos != syncPositionAfter {
t.Errorf("TestNewInviteEventForUser want %v, got %v", syncPositionAfter, pos)
@@ -191,7 +191,7 @@ func TestEDUWakeup(t *testing.T) {
go func() {
pos, err := waitForEvents(n, newTestSyncRequest(bob, syncPositionAfter))
if err != nil {
- t.Errorf("TestNewInviteEventForUser error: %s", err)
+ t.Errorf("TestNewInviteEventForUser error: %w", err)
}
if pos != syncPositionNewEDU {
t.Errorf("TestNewInviteEventForUser want %v, got %v", syncPositionNewEDU, pos)
@@ -219,7 +219,7 @@ func TestMultipleRequestWakeup(t *testing.T) {
poll := func() {
pos, err := waitForEvents(n, newTestSyncRequest(bob, syncPositionBefore))
if err != nil {
- t.Errorf("TestMultipleRequestWakeup error: %s", err)
+ t.Errorf("TestMultipleRequestWakeup error: %w", err)
}
if pos != syncPositionAfter {
t.Errorf("TestMultipleRequestWakeup want %v, got %v", syncPositionAfter, pos)
@@ -259,7 +259,7 @@ func TestNewEventAndWasPreviouslyJoinedToRoom(t *testing.T) {
go func() {
pos, err := waitForEvents(n, newTestSyncRequest(bob, syncPositionBefore))
if err != nil {
- t.Errorf("TestNewEventAndWasPreviouslyJoinedToRoom error: %s", err)
+ t.Errorf("TestNewEventAndWasPreviouslyJoinedToRoom error: %w", err)
}
if pos != syncPositionAfter {
t.Errorf("TestNewEventAndWasPreviouslyJoinedToRoom want %v, got %v", syncPositionAfter, pos)
@@ -278,7 +278,7 @@ func TestNewEventAndWasPreviouslyJoinedToRoom(t *testing.T) {
go func() {
pos, err := waitForEvents(n, newTestSyncRequest(alice, syncPositionAfter))
if err != nil {
- t.Errorf("TestNewEventAndWasPreviouslyJoinedToRoom error: %s", err)
+ t.Errorf("TestNewEventAndWasPreviouslyJoinedToRoom error: %w", err)
}
if pos != syncPositionAfter2 {
t.Errorf("TestNewEventAndWasPreviouslyJoinedToRoom want %v, got %v", syncPositionAfter2, pos)