mirror of
https://github.com/element-hq/dendrite.git
synced 2025-09-13 12:52:24 +03:00
Take advantage of changes in recent Go versions (#3361)
Given that #2714 wasn't merged but we are now at a minimum supported Go version of 1.20 (soon to be 1.21), I wanted to carry over some of the changes. Namely: - Fix the log typo - Simplify build constraints for unix - Use stdlib atomic package ### Pull Request Checklist <!-- Please read https://matrix-org.github.io/dendrite/development/contributing before submitting your pull request --> * [x] I have added Go unit tests or [Complement integration tests](https://github.com/matrix-org/complement) for this PR _or_ I have justified why this PR doesn't need tests * [x] Pull request includes a [sign off below using a legally identifiable name](https://matrix-org.github.io/dendrite/development/contributing#sign-off) _or_ I have already signed off privately Signed-off-by: `0x1a8510f2 <admin@0x1a8510f2.space>` --------- Co-authored-by: devonh <devon.dmytro@gmail.com>
This commit is contained in:
parent
5547bf8ca6
commit
46902e5766
10 changed files with 23 additions and 24 deletions
|
@ -19,6 +19,7 @@ import (
|
|||
"encoding/json"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
|
@ -26,7 +27,6 @@ import (
|
|||
"github.com/matrix-org/gomatrixserverlib/spec"
|
||||
"github.com/nats-io/nats.go"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"go.uber.org/atomic"
|
||||
"gotest.tools/v3/poll"
|
||||
|
||||
"github.com/matrix-org/dendrite/federationapi/producers"
|
||||
|
@ -228,7 +228,7 @@ func TestProcessTransactionRequestEDUTyping(t *testing.T) {
|
|||
ctx := process.NewProcessContext()
|
||||
defer ctx.ShutdownDendrite()
|
||||
txn, js, cfg := createTransactionWithEDU(ctx, edus)
|
||||
received := atomic.NewBool(false)
|
||||
received := atomic.Bool{}
|
||||
onMessage := func(ctx context.Context, msgs []*nats.Msg) bool {
|
||||
msg := msgs[0] // Guaranteed to exist if onMessage is called
|
||||
room := msg.Header.Get(jetstream.RoomID)
|
||||
|
@ -294,7 +294,7 @@ func TestProcessTransactionRequestEDUToDevice(t *testing.T) {
|
|||
ctx := process.NewProcessContext()
|
||||
defer ctx.ShutdownDendrite()
|
||||
txn, js, cfg := createTransactionWithEDU(ctx, edus)
|
||||
received := atomic.NewBool(false)
|
||||
received := atomic.Bool{}
|
||||
onMessage := func(ctx context.Context, msgs []*nats.Msg) bool {
|
||||
msg := msgs[0] // Guaranteed to exist if onMessage is called
|
||||
|
||||
|
@ -371,7 +371,7 @@ func TestProcessTransactionRequestEDUDeviceListUpdate(t *testing.T) {
|
|||
ctx := process.NewProcessContext()
|
||||
defer ctx.ShutdownDendrite()
|
||||
txn, js, cfg := createTransactionWithEDU(ctx, edus)
|
||||
received := atomic.NewBool(false)
|
||||
received := atomic.Bool{}
|
||||
onMessage := func(ctx context.Context, msgs []*nats.Msg) bool {
|
||||
msg := msgs[0] // Guaranteed to exist if onMessage is called
|
||||
|
||||
|
@ -468,7 +468,7 @@ func TestProcessTransactionRequestEDUReceipt(t *testing.T) {
|
|||
ctx := process.NewProcessContext()
|
||||
defer ctx.ShutdownDendrite()
|
||||
txn, js, cfg := createTransactionWithEDU(ctx, edus)
|
||||
received := atomic.NewBool(false)
|
||||
received := atomic.Bool{}
|
||||
onMessage := func(ctx context.Context, msgs []*nats.Msg) bool {
|
||||
msg := msgs[0] // Guaranteed to exist if onMessage is called
|
||||
|
||||
|
@ -512,7 +512,7 @@ func TestProcessTransactionRequestEDUSigningKeyUpdate(t *testing.T) {
|
|||
ctx := process.NewProcessContext()
|
||||
defer ctx.ShutdownDendrite()
|
||||
txn, js, cfg := createTransactionWithEDU(ctx, edus)
|
||||
received := atomic.NewBool(false)
|
||||
received := atomic.Bool{}
|
||||
onMessage := func(ctx context.Context, msgs []*nats.Msg) bool {
|
||||
msg := msgs[0] // Guaranteed to exist if onMessage is called
|
||||
|
||||
|
@ -569,7 +569,7 @@ func TestProcessTransactionRequestEDUPresence(t *testing.T) {
|
|||
ctx := process.NewProcessContext()
|
||||
defer ctx.ShutdownDendrite()
|
||||
txn, js, cfg := createTransactionWithEDU(ctx, edus)
|
||||
received := atomic.NewBool(false)
|
||||
received := atomic.Bool{}
|
||||
onMessage := func(ctx context.Context, msgs []*nats.Msg) bool {
|
||||
msg := msgs[0] // Guaranteed to exist if onMessage is called
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue