summaryrefslogtreecommitdiff
path: root/internal/federation/federatingprotocol_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/federation/federatingprotocol_test.go')
-rw-r--r--internal/federation/federatingprotocol_test.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/federation/federatingprotocol_test.go b/internal/federation/federatingprotocol_test.go
index f975cd7d6..085d6c474 100644
--- a/internal/federation/federatingprotocol_test.go
+++ b/internal/federation/federatingprotocol_test.go
@@ -21,13 +21,13 @@ import (
"bytes"
"context"
"encoding/json"
- "errors"
"io"
"net/http"
"net/http/httptest"
"net/url"
"testing"
+ errorsv2 "codeberg.org/gruf/go-errors/v2"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/gtscontext"
@@ -101,8 +101,8 @@ func (suite *FederatingProtocolTestSuite) authenticatePostInbox(
recorder := httptest.NewRecorder()
newContext, authed, err := suite.federator.AuthenticatePostInbox(ctx, recorder, request)
- if withCode := new(gtserror.WithCode); (errors.As(err, withCode) &&
- (*withCode).Code() >= 500) || (err != nil && (*withCode) == nil) {
+ if withCode := errorsv2.AsV2[gtserror.WithCode](err); // nocollapse
+ (withCode != nil && withCode.Code() >= 500) || (err != nil && withCode == nil) {
// NOTE: the behaviour here is a little strange as we have
// the competing code styles of the go-fed interface expecting
// that any err is a no-go, but authed bool is intended to be