Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.
Go dockerfossgomarkdownmemomicroblognote-takingnotesopen-sourceown-your-datareactself-hostedsqlitetimeline
fix: remove errors.Wrap(nil) (#4576)
cmuangsd649d326ef5e
diff --git a/store/db/mysql/inbox.go b/store/db/mysql/inbox.goindex 5932f46d3..a18fb51f1 100644--- a/store/db/mysql/inbox.go+++ b/store/db/mysql/inbox.go@@ -110,7 +110,7 @@ func (d *DB) GetInbox(ctx context.Context, find *store.FindInbox) (*store.Inbox,return nil, errors.Wrap(err, "failed to get inbox")}if len(list) != 1 {- return nil, errors.Wrapf(nil, "unexpected inbox count: %d", len(list))+ return nil, errors.Errorf("unexpected inbox count: %d", len(list))}return list[0], nil}diff --git a/store/db/mysql/user.go b/store/db/mysql/user.goindex 9bf2d9640..fab15066a 100644--- a/store/db/mysql/user.go+++ b/store/db/mysql/user.go@@ -32,7 +32,7 @@ func (d *DB) CreateUser(ctx context.Context, create *store.User) (*store.User, ereturn nil, err}if len(list) != 1 {- return nil, errors.Wrapf(nil, "unexpected user count: %d", len(list))+ return nil, errors.Errorf("unexpected user count: %d", len(list))}return list[0], nil@@ -142,7 +142,7 @@ func (d *DB) GetUser(ctx context.Context, find *store.FindUser) (*store.User, erreturn nil, err}if len(list) != 1 {- return nil, errors.Wrapf(nil, "unexpected user count: %d", len(list))+ return nil, errors.Errorf("unexpected user count: %d", len(list))}return list[0], nil}diff --git a/store/db/postgres/inbox.go b/store/db/postgres/inbox.goindex 81a80427b..1777d801d 100644--- a/store/db/postgres/inbox.go+++ b/store/db/postgres/inbox.go@@ -100,7 +100,7 @@ func (d *DB) GetInbox(ctx context.Context, find *store.FindInbox) (*store.Inbox,return nil, errors.Wrap(err, "failed to get inbox")}if len(list) != 1 {- return nil, errors.Wrapf(nil, "unexpected inbox count: %d", len(list))+ return nil, errors.Errorf("unexpected inbox count: %d", len(list))}return list[0], nil}diff --git a/store/resource.go b/store/resource.goindex 71aec1db7..fdb68d47f 100644--- a/store/resource.go+++ b/store/resource.go@@ -103,7 +103,7 @@ func (s *Store) DeleteResource(ctx context.Context, delete *DeleteResource) erroreturn errors.Wrap(err, "failed to get resource")}if resource == nil {- return errors.Wrap(nil, "resource not found")+ return errors.New("resource not found")}if resource.StorageType == storepb.ResourceStorageType_LOCAL {diff --git a/store/test/resource_test.go b/store/test/resource_test.goindex 663e9d8ad..dcf6751bf 100644--- a/store/test/resource_test.go+++ b/store/test/resource_test.go@@ -58,6 +58,6 @@ func TestResourceStore(t *testing.T) {err = ts.DeleteResource(ctx, &store.DeleteResource{ID: 2,})- require.NoError(t, err)+ require.ErrorContains(t, err, "resource not found")ts.Close()}