Skip to content

Commit 7fada7e

Browse files
committed
Improve social package struct field alignment.
1 parent 13af91f commit 7fada7e

File tree

4 files changed

+17
-16
lines changed

4 files changed

+17
-16
lines changed

server/api_test.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import (
2424
"github.com/golang/protobuf/jsonpb"
2525
"github.com/heroiclabs/nakama-common/api"
2626
"github.com/heroiclabs/nakama-common/rtapi"
27+
"github.com/heroiclabs/nakama-common/runtime"
2728
"github.com/heroiclabs/nakama/v3/apigrpc"
2829
_ "github.com/jackc/pgx/stdlib"
2930
"go.uber.org/zap"
@@ -108,7 +109,7 @@ func (d *DummySession) SendBytes(payload []byte, reliable bool) error {
108109
return nil
109110
}
110111

111-
func (d *DummySession) Close(reason string) {}
112+
func (d *DummySession) Close(msg string, reason runtime.PresenceReason) {}
112113

113114
type loggerEnabler struct{}
114115

@@ -167,7 +168,7 @@ func NewAPIServer(t *testing.T, runtime *Runtime) (*ApiServer, *Pipeline) {
167168
router := &DummyMessageRouter{}
168169
tracker := &LocalTracker{}
169170
pipeline := NewPipeline(logger, cfg, db, jsonpbMarshaler, jsonpbUnmarshaler, nil, nil, nil, nil, nil, tracker, router, runtime)
170-
apiServer := StartApiServer(logger, logger, db, jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, tracker, router, metrics, pipeline, runtime)
171+
apiServer := StartApiServer(logger, logger, db, jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, tracker, router, metrics, pipeline, runtime)
171172
return apiServer, pipeline
172173
}
173174

server/core_wallet_test.go

+7-7
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func TestUpdateWalletSingleUser(t *testing.T) {
7070
}
7171

7272
db := NewDB(t)
73-
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil)
73+
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
7474

7575
userID, _, _, err := AuthenticateCustom(context.Background(), logger, db, uuid.Must(uuid.NewV4()).String(), uuid.Must(uuid.NewV4()).String(), true)
7676
if err != nil {
@@ -148,7 +148,7 @@ func TestUpdateWalletMultiUser(t *testing.T) {
148148
}
149149

150150
db := NewDB(t)
151-
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil)
151+
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
152152
count := 5
153153

154154
userIDs := make([]string, 0, count)
@@ -235,7 +235,7 @@ func TestUpdateWalletsMultiUser(t *testing.T) {
235235
}
236236

237237
db := NewDB(t)
238-
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil)
238+
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
239239
count := 5
240240

241241
userIDs := make([]string, 0, count)
@@ -327,7 +327,7 @@ func TestUpdateWalletsMultiUserSharedChangeset(t *testing.T) {
327327
}
328328

329329
db := NewDB(t)
330-
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil)
330+
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
331331
count := 5
332332

333333
userIDs := make([]string, 0, count)
@@ -423,7 +423,7 @@ func TestUpdateWalletsMultiUserSharedChangesetDeductions(t *testing.T) {
423423
}
424424

425425
db := NewDB(t)
426-
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil)
426+
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
427427
count := 5
428428

429429
userIDs := make([]string, 0, count)
@@ -478,7 +478,7 @@ func TestUpdateWalletsMultiUserSharedChangesetDeductions(t *testing.T) {
478478

479479
func TestUpdateWalletsSingleUser(t *testing.T) {
480480
db := NewDB(t)
481-
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil)
481+
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
482482

483483
userID, _, _, err := AuthenticateCustom(context.Background(), logger, db, uuid.Must(uuid.NewV4()).String(), uuid.Must(uuid.NewV4()).String(), true)
484484
if err != nil {
@@ -525,7 +525,7 @@ func TestUpdateWalletsSingleUser(t *testing.T) {
525525

526526
func TestUpdateWalletRepeatedSingleUser(t *testing.T) {
527527
db := NewDB(t)
528-
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil)
528+
nk := NewRuntimeGoNakamaModule(logger, db, nil, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil)
529529

530530
userID, _, _, err := AuthenticateCustom(context.Background(), logger, db, uuid.Must(uuid.NewV4()).String(), uuid.Must(uuid.NewV4()).String(), true)
531531
if err != nil {

server/runtime_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func runtimeWithModules(t *testing.T, modules map[string]string) (*Runtime, *Run
7777
cfg := NewConfig(logger)
7878
cfg.Runtime.Path = dir
7979

80-
return NewRuntime(logger, logger, NewDB(t), jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, metrics, nil, &DummyMessageRouter{})
80+
return NewRuntime(logger, logger, NewDB(t), jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, metrics, nil, &DummyMessageRouter{})
8181
}
8282

8383
func TestRuntimeSampleScript(t *testing.T) {
@@ -355,7 +355,7 @@ nakama.register_rpc(test.printWorld, "helloworld")`,
355355

356356
db := NewDB(t)
357357
pipeline := NewPipeline(logger, cfg, db, jsonpbMarshaler, jsonpbUnmarshaler, nil, nil, nil, nil, nil, nil, nil, runtime)
358-
apiServer := StartApiServer(logger, logger, db, jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, metrics, pipeline, runtime)
358+
apiServer := StartApiServer(logger, logger, db, jsonpbMarshaler, jsonpbUnmarshaler, cfg, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, metrics, pipeline, runtime)
359359
defer apiServer.Stop()
360360

361361
payload := "\"Hello World\""

social/social.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ type JwksCerts struct {
6666

6767
// JWK certificate data for an Apple Sign In verification key.
6868
type JwksCert struct {
69+
key *rsa.PublicKey
70+
6971
Kty string `json:"kty"`
7072
Kid string `json:"kid"`
7173
Use string `json:"use"`
7274
Alg string `json:"alg"`
7375
N string `json:"n"`
7476
E string `json:"e"`
75-
76-
key *rsa.PublicKey
7777
}
7878

7979
// AppleProfile is an abbreviated version of a user authenticated through Apple Sign In.
@@ -103,8 +103,8 @@ type facebookPaging struct {
103103
}
104104

105105
type facebookFriends struct {
106-
Data []FacebookProfile `json:"data"`
107106
Paging facebookPaging `json:"paging"`
107+
Data []FacebookProfile `json:"data"`
108108
}
109109

110110
// GoogleProfile is an abbreviated version of a Google profile extracted from in a verified ID token.
@@ -141,8 +141,8 @@ type steamFriendsWrapper struct {
141141

142142
// SteamError contains a possible error response from the Steam Web API.
143143
type SteamError struct {
144-
ErrorCode int `json:"errorcode"`
145144
ErrorDesc string `json:"errordesc"`
145+
ErrorCode int `json:"errorcode"`
146146
}
147147

148148
// Unwrapping the SteamProfile
@@ -276,9 +276,9 @@ func (c *Client) ExtractFacebookInstantGameID(signedPlayerInfo string, appSecret
276276

277277
var payload struct {
278278
Algorithm string `json:"algorithm"`
279-
IssuedAt int `json:"issued_at"`
280279
PlayerID string `json:"player_id"`
281280
RequestPayload string `json:"request_payload"` // discarded
281+
IssuedAt int `json:"issued_at"`
282282
}
283283
err = json.Unmarshal(payloadRaw, &payload)
284284
if err != nil {

0 commit comments

Comments
 (0)