1
1
mirror of https://github.com/OpenDiablo2/OpenDiablo2 synced 2024-11-10 06:16:27 -05:00

Merge pull request #1124 from gucio321/golangci-lint-update

all: fix lint errors
This commit is contained in:
gravestench 2021-05-14 15:26:03 -07:00 committed by GitHub
commit a688d660a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 4 deletions

View File

@ -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

View File

@ -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) {

View File

@ -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
}

View File

@ -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: