[chore] some tidy ups (#3677)

* small formatting changes (no logic)

* improve code comments

* fix import cycle

* shutup stinky linter
This commit is contained in:
kim 2025-01-27 15:54:59 +00:00 committed by GitHub
commit 726d2ba483
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 51 additions and 47 deletions

View file

@ -24,6 +24,9 @@ import (
"testing"
"time"
// for go:linkname
_ "unsafe"
"github.com/stretchr/testify/suite"
"github.com/superseriousbusiness/gotosocial/internal/cleaner"
"github.com/superseriousbusiness/gotosocial/internal/db"
@ -120,7 +123,7 @@ func (suite *RealSenderStandardTestSuite) SetupTest() {
suite.oauthServer = testrig.NewTestOauthServer(suite.db)
suite.emailSender = testrig.NewEmailSender("../../web/template/", nil)
suite.webPushSender = webpush.NewRealSender(
suite.webPushSender = newSenderWith(
&http.Client{
Transport: suite,
},
@ -261,3 +264,6 @@ func (suite *RealSenderStandardTestSuite) TestServerError() {
func TestRealSenderStandardTestSuite(t *testing.T) {
suite.Run(t, &RealSenderStandardTestSuite{})
}
//go:linkname newSenderWith github.com/superseriousbusiness/gotosocial/internal/webpush.newSenderWith
func newSenderWith(*http.Client, *state.State, *typeutils.Converter) webpush.Sender