From c938b745a2c06f9b02bf9ffc02caacce8cbf5ba8 Mon Sep 17 00:00:00 2001 From: gucio321 Date: Wed, 12 May 2021 08:30:28 +0200 Subject: [PATCH] all: fix lint errors --- .golangci.yml | 3 ++- d2common/d2fileformats/d2ds1/ds1_layers.go | 3 +-- d2core/d2records/set_item_loader.go | 2 ++ d2game/d2player/party_panel.go | 3 ++- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index f8d9e85d..95f96c3a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -32,6 +32,8 @@ linters-settings: # to possibly non-intuitive layout of struct fields (harder to read). Disable # `fieldalignment` check here until we evaluate if it is worthwhile. - fieldalignment + # https://github.com/golangci/golangci-lint/issues/1973 + - sigchanyzer lll: line-length: 140 misspell: @@ -68,7 +70,6 @@ linters: - nakedret - prealloc - rowserrcheck - - scopelint - staticcheck - structcheck - stylecheck diff --git a/d2common/d2fileformats/d2ds1/ds1_layers.go b/d2common/d2fileformats/d2ds1/ds1_layers.go index f187a84c..a8dc4925 100644 --- a/d2common/d2fileformats/d2ds1/ds1_layers.go +++ b/d2common/d2fileformats/d2ds1/ds1_layers.go @@ -228,8 +228,7 @@ func (l *ds1Layers) insert(t LayerGroupType, idx int, newLayer *Layer) { // idx=1 // newLayer=c // existing layerGroup is [a, b] - newGroup := append((*group)[:idx], append([]*Layer{newLayer}, (*group)[idx:]...)...) - *group = newGroup + *group = append((*group)[:idx], append([]*Layer{newLayer}, (*group)[idx:]...)...) } func (l *ds1Layers) delete(t LayerGroupType, idx int) { diff --git a/d2core/d2records/set_item_loader.go b/d2core/d2records/set_item_loader.go index 88021cbf..c436ff92 100644 --- a/d2core/d2records/set_item_loader.go +++ b/d2core/d2records/set_item_loader.go @@ -84,6 +84,8 @@ func setItemLoader(r *RecordManager, d *d2txt.DataDictionary) error { } record.Properties = props + record.SetPropertiesLevel1 = bonus1 + record.SetPropertiesLevel2 = bonus2 records[record.SetItemKey] = record } diff --git a/d2game/d2player/party_panel.go b/d2game/d2player/party_panel.go index 88b273ce..fefb9fc3 100644 --- a/d2game/d2player/party_panel.go +++ b/d2game/d2player/party_panel.go @@ -97,6 +97,7 @@ func NewPartyPanel(asset *d2asset.AssetManager, } pp.partyIndexes = partyIndexes + pp.indexes = indexes pp.Logger = d2util.NewLogger() pp.Logger.SetLevel(l) @@ -231,7 +232,7 @@ func (pi *partyIndex) setNameTooltipText() { // setColor sets appropriate labels' colors func (pi *partyIndex) setColor(relations d2enum.PlayersRelationships) { - var color = d2util.Color(white) + color := d2util.Color(white) switch relations { case d2enum.PlayerRelationEnemy: