chore: update golangci config
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Dawid Wysokiński 2023-04-30 06:23:45 +02:00
parent e246883f94
commit ad9673cef5
Signed by: Kichiyaki
GPG Key ID: B5445E357FB8B892
4 changed files with 31 additions and 29 deletions

View File

@ -5,10 +5,15 @@ run:
linters:
disable-all: true
enable:
- asasalint
- asciicheck
- bodyclose
- bidichk
- exportloopref
- depguard
- errcheck
- gocritic
- gosec
- gofmt
- goimports
- gosimple
@ -43,6 +48,9 @@ linters:
- errname
- forcetypeassert
- durationcheck
- predeclared
- promlinter
- wastedassign
linters-settings:
tagliatelle:

View File

@ -19,17 +19,11 @@ func NewSnapshotPublisher(publisher message.Publisher, marshaler CommandEventMar
}
func (s *SnapshotPublisher) CmdCreatePlayers(ctx context.Context, payloads ...domain.CreateSnapshotsCmdPayload) error {
if err := s.publishCmdCreate(ctx, playersCmdCreateSnapshots, payloads...); err != nil {
return err
}
return nil
return s.publishCmdCreate(ctx, playersCmdCreateSnapshots, payloads...)
}
func (s *SnapshotPublisher) CmdCreateTribes(ctx context.Context, payloads ...domain.CreateSnapshotsCmdPayload) error {
if err := s.publishCmdCreate(ctx, tribesCmdCreateSnapshots, payloads...); err != nil {
return err
}
return nil
return s.publishCmdCreate(ctx, tribesCmdCreateSnapshots, payloads...)
}
func (s *SnapshotPublisher) publishCmdCreate(

View File

@ -869,16 +869,16 @@ func TestPlayer_listOtherServers(t *testing.T) {
Open: true,
}
var playerID int64 = 998
playerIdStr := strconv.FormatInt(playerID, 10)
playerIDStr := strconv.FormatInt(playerID, 10)
player := domain.PlayerWithRelations{
Player: domain.Player{
ID: playerID,
Name: "name " + playerIdStr,
Name: "name " + playerIDStr,
NumVillages: 1,
Points: 2,
Rank: 3,
TribeID: 4,
ProfileURL: "profile-" + playerIdStr,
ProfileURL: "profile-" + playerIDStr,
BestRank: 1234,
BestRankAt: time.Now(),
MostPoints: 1235,
@ -942,12 +942,12 @@ func TestPlayer_listOtherServers(t *testing.T) {
ScoreTotal: 1,
},
ID: playerID,
Name: "name " + playerIdStr,
Name: "name " + playerIDStr,
NumVillages: 5,
Points: 4,
Rank: 2,
TribeID: 1234,
ProfileURL: "profile-" + playerIdStr,
ProfileURL: "profile-" + playerIDStr,
BestRank: 111,
BestRankAt: now,
MostPoints: 1112,
@ -982,12 +982,12 @@ func TestPlayer_listOtherServers(t *testing.T) {
ScoreTotal: 8,
},
ID: playerID,
Name: "name " + playerIdStr,
Name: "name " + playerIDStr,
NumVillages: 2,
Points: 3,
Rank: 4,
TribeID: 0,
ProfileURL: "profile-" + playerIdStr,
ProfileURL: "profile-" + playerIDStr,
BestRank: 1117,
BestRankAt: now,
MostPoints: 1115,
@ -1009,7 +1009,7 @@ func TestPlayer_listOtherServers(t *testing.T) {
},
versionCode: version.Code,
serverKey: serverPL151.Key,
playerID: playerIdStr,
playerID: playerIDStr,
expectedStatus: http.StatusOK,
target: &model.ListPlayerOtherServersResp{},
expectedResponse: &model.ListPlayerOtherServersResp{
@ -1025,11 +1025,11 @@ func TestPlayer_listOtherServers(t *testing.T) {
RankTotal: 2,
ScoreTotal: 1,
ID: playerID,
Name: "name " + playerIdStr,
Name: "name " + playerIDStr,
NumVillages: 5,
Points: 4,
Rank: 2,
ProfileURL: "profile-" + playerIdStr,
ProfileURL: "profile-" + playerIDStr,
BestRank: 111,
BestRankAt: now,
MostPoints: 1112,
@ -1065,11 +1065,11 @@ func TestPlayer_listOtherServers(t *testing.T) {
RankTotal: 7,
ScoreTotal: 8,
ID: playerID,
Name: "name " + playerIdStr,
Name: "name " + playerIDStr,
NumVillages: 2,
Points: 3,
Rank: 4,
ProfileURL: "profile-" + playerIdStr,
ProfileURL: "profile-" + playerIDStr,
BestRank: 1117,
BestRankAt: now,
MostPoints: 1115,
@ -1127,12 +1127,12 @@ func TestPlayer_listOtherServers(t *testing.T) {
ScoreTotal: 8,
},
ID: playerID,
Name: "name " + playerIdStr,
Name: "name " + playerIDStr,
NumVillages: 2,
Points: 3,
Rank: 4,
TribeID: 0,
ProfileURL: "profile-" + playerIdStr,
ProfileURL: "profile-" + playerIDStr,
BestRank: 1117,
BestRankAt: now,
MostPoints: 1115,
@ -1153,7 +1153,7 @@ func TestPlayer_listOtherServers(t *testing.T) {
},
versionCode: version.Code,
serverKey: serverPL151.Key,
playerID: playerIdStr,
playerID: playerIDStr,
queryParams: url.Values{
"limit": []string{"1"},
"offset": []string{"1"},
@ -1213,7 +1213,7 @@ func TestPlayer_listOtherServers(t *testing.T) {
},
versionCode: version.Code,
serverKey: serverPL151.Key,
playerID: playerIdStr,
playerID: playerIDStr,
queryParams: url.Values{
"limit": []string{"asd"},
},
@ -1236,7 +1236,7 @@ func TestPlayer_listOtherServers(t *testing.T) {
},
versionCode: version.Code,
serverKey: serverPL151.Key,
playerID: playerIdStr,
playerID: playerIDStr,
queryParams: url.Values{
"offset": []string{"asd"},
},
@ -1257,7 +1257,7 @@ func TestPlayer_listOtherServers(t *testing.T) {
},
versionCode: version.Code + "2",
serverKey: serverPL151.Key,
playerID: playerIdStr,
playerID: playerIDStr,
expectedStatus: http.StatusNotFound,
target: &model.ErrorResp{},
expectedResponse: &model.ErrorResp{
@ -1276,7 +1276,7 @@ func TestPlayer_listOtherServers(t *testing.T) {
},
versionCode: version.Code,
serverKey: serverPL151.Key + "2",
playerID: playerIdStr,
playerID: playerIDStr,
expectedStatus: http.StatusNotFound,
target: &model.ErrorResp{},
expectedResponse: &model.ErrorResp{

View File

@ -125,8 +125,8 @@ func TestEnnoblement_Refresh(t *testing.T) {
}
require.Equal(t, 1, client.GetEnnoblementsCallCount())
_, argUrl, argSince := client.GetEnnoblementsArgsForCall(0)
assert.Equal(t, tt.url, argUrl)
_, argURL, argSince := client.GetEnnoblementsArgsForCall(0)
assert.Equal(t, tt.url, argURL)
if len(tt.ennoblementsRepo) > 0 {
assert.Equal(t, tt.ennoblementsRepo[0].CreatedAt, argSince)
} else {