Skip to content

Commit 7e2a47d

Browse files
committed
refactor: fix linter issues
1 parent 14845e2 commit 7e2a47d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+141
-112
lines changed

internal/app/assetui/browser.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,9 +410,8 @@ func addNodes(td *xwidget.TreeData[assetContainerNode], parent *assetContainerNo
410410
case assetSafety:
411411
if isCorporation {
412412
return category != asset.NodeAssetSafetyCorporation
413-
} else {
414-
return category != asset.NodeAssetSafetyCharacter
415413
}
414+
return category != asset.NodeAssetSafetyCharacter
416415
}
417416
return false
418417
}
@@ -588,7 +587,7 @@ func newAssetBrowserContainer(ab *Browser) *assetBrowserContainer {
588587
a.grid = a.makeAssetGrid()
589588
a.location = newAssetBrowserLocation(a)
590589

591-
a.search.OnChanged = func(s string) {
590+
a.search.OnChanged = func(_ string) {
592591
a.filterItemsAsync()
593592
}
594593
a.search.ActionItem = kxwidget.NewIconButton(theme.CancelIcon(), func() {

internal/app/assetui/search.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ func newAssetSearch(u ui, forCorporation bool) *Search {
416416
assetsTotalYes,
417417
assetsTotalNo,
418418
},
419-
func(s string) {
419+
func(_ string) {
420420
a.filterRowsAsync(-1)
421421
},
422422
)
@@ -454,7 +454,7 @@ func newAssetSearch(u ui, forCorporation bool) *Search {
454454
a.u.Signals().CharacterRemoved.AddListener(func(ctx context.Context, _ *app.EntityShort) {
455455
a.Update(ctx)
456456
})
457-
a.u.Signals().TagsChanged.AddListener(func(ctx context.Context, s struct{}) {
457+
a.u.Signals().TagsChanged.AddListener(func(ctx context.Context, _ struct{}) {
458458
a.Update(ctx)
459459
})
460460
a.u.Signals().CorporationSectionChanged.AddListener(func(ctx context.Context, arg app.CorporationSectionUpdated) {

internal/app/awidget/mailheader.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ func NewMailHeader(loadIcon func(o *app.EveEntity, setIcon func(r fyne.Resource)
113113
return w
114114
}
115115

116-
func (w *MailHeader) Set(characterID int64, from *app.EveEntity, timestamp time.Time, recipients ...*app.EveEntity) {
116+
func (w *MailHeader) Set(from *app.EveEntity, timestamp time.Time, recipients ...*app.EveEntity) {
117117
w.timestamp.Text = timestamp.Format(app.DateTimeFormat)
118118
w.recipients.RemoveAll()
119119
for _, r := range recipients {

internal/app/characterservice/contracts.go

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ func (s *CharacterService) GetContractTopBid(ctx context.Context, contractID int
4141
if len(bids) == 0 {
4242
return nil, app.ErrNotFound
4343
}
44-
var max float32
44+
var maximum float32
4545
var top *app.CharacterContractBid
4646
for _, b := range bids {
47-
if top == nil || b.Amount > max {
47+
if top == nil || b.Amount > maximum {
4848
top = b
4949
}
5050
}
@@ -211,9 +211,8 @@ func (s *CharacterService) updateContractsESI(ctx context.Context, arg character
211211
if err := s.createNewContract(ctx, characterID, c); err != nil {
212212
slog.Error("create contract", "contract", c, "error", err)
213213
continue
214-
} else {
215-
count++
216214
}
215+
count++
217216
}
218217
slog.Info("Stored new contracts", "characterID", characterID, "count", count)
219218
}
@@ -223,9 +222,8 @@ func (s *CharacterService) updateContractsESI(ctx context.Context, arg character
223222
if err := s.updateContract(ctx, characterID, c); err != nil {
224223
slog.Error("update contract", "contract", c, "error", err)
225224
continue
226-
} else {
227-
count++
228225
}
226+
count++
229227
}
230228
slog.Info("Updated contracts", "characterID", characterID, "count", count)
231229
}

internal/app/characterui/charactersheet.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,10 @@ func (a *CharacterSheet) update(ctx context.Context) {
170170
slog.Error("Failed to fetch character for sheet", "err", err)
171171
setName("ERROR: " + a.u.ErrorDisplay(err))
172172
return
173-
} else {
174-
a.character.Store(c2)
175-
c = c2
176173
}
174+
a.character.Store(c2)
175+
c = c2
176+
177177
fyne.Do(func() {
178178
a.name.SetText(c.EveCharacter.Name)
179179
a.name.OnTapped = func() {

internal/app/characterui/communications.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ func (w *communicationDetail) CreateRenderer() fyne.WidgetRenderer {
449449

450450
func (w *communicationDetail) set(n *app.CharacterNotification, recipient *app.EveEntity) error {
451451
w.subject.SetText(n.TitleDisplay())
452-
w.header.Set(n.CharacterID, n.Sender, n.Timestamp, recipient)
452+
w.header.Set(n.Sender, n.Timestamp, recipient)
453453
b, err := n.BodyPlain() // using markdown blocked by #61
454454
if err != nil {
455455
return fmt.Errorf("failed to convert markdown for notification %+v: %w", n, err)

internal/app/characterui/contracts.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ func newContracts(u contractUIServices, forCorporation bool) *Contracts {
212212
},
213213
a.columnSorter,
214214
a.filterRowsAsync,
215-
func(column int, r contractRow) {
215+
func(_ int, r contractRow) {
216216
if a.forCorporation {
217217
ShowCorporationContractWindow(a.u, r.corporationID, r.contractID)
218218
} else {
@@ -277,7 +277,7 @@ func newContracts(u contractUIServices, forCorporation bool) *Contracts {
277277
a.u.Signals().CharacterRemoved.AddListener(func(ctx context.Context, _ *app.EntityShort) {
278278
a.Update(ctx)
279279
})
280-
a.u.Signals().TagsChanged.AddListener(func(ctx context.Context, s struct{}) {
280+
a.u.Signals().TagsChanged.AddListener(func(ctx context.Context, _ struct{}) {
281281
a.Update(ctx)
282282
})
283283
}
@@ -315,14 +315,14 @@ func (a *Contracts) makeDataList() *xwidget.StripedList {
315315
},
316316
func() fyne.CanvasObject {
317317
title := widget.NewLabelWithStyle("Template", fyne.TextAlignLeading, fyne.TextStyle{Bold: true})
318-
type_ := widget.NewLabel("Template")
318+
et := widget.NewLabel("Template")
319319
status := xwidget.NewRichTextWithText("Template")
320320
issuer := widget.NewLabel("Template")
321321
assignee := widget.NewLabel("Template")
322322
dateExpired := xwidget.NewRichTextWithText("Template")
323323
return container.New(layout.NewCustomPaddedVBoxLayout(-p),
324324
title,
325-
container.NewHBox(type_, layout.NewSpacer(), status),
325+
container.NewHBox(et, layout.NewSpacer(), status),
326326
issuer,
327327
assignee,
328328
dateExpired,
@@ -374,7 +374,7 @@ func (a *Contracts) filterRowsAsync(sortCol int) {
374374
rows := slices.Clone(a.rows)
375375
issuer := a.selectIssuer.Selected
376376
assignee := a.selectAssignee.Selected
377-
type_ := a.selectType.Selected
377+
et := a.selectType.Selected
378378
tag := a.selectTag.Selected
379379
sortCol, dir, doSort := a.columnSorter.CalcSort(sortCol)
380380

@@ -405,9 +405,9 @@ func (a *Contracts) filterRowsAsync(sortCol int) {
405405
return r.assigneeName != assignee
406406
})
407407
}
408-
if type_ != "" {
408+
if et != "" {
409409
rows = slices.DeleteFunc(rows, func(r contractRow) bool {
410-
return r.typeName != type_
410+
return r.typeName != et
411411
})
412412
}
413413
if tag != "" {

internal/app/characterui/mails.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ func (w *mailDetail) clear() {
868868
func (w *mailDetail) SetMail(m *app.CharacterMail) {
869869
w.subject.SetText(m.Subject.ValueOrZero())
870870
w.SetBody(m.BodyPlain())
871-
w.header.Set(m.CharacterID, m.From, m.Timestamp, m.Recipients...)
871+
w.header.Set(m.From, m.Timestamp, m.Recipients...)
872872
}
873873

874874
func (w *mailDetail) SetBody(s string) {

internal/app/characterui/overview.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ func NewOverview(u ui) *Overview {
168168
a.search.SetText("")
169169
a.filterRowsAsync(-1)
170170
})
171-
a.search.OnChanged = func(s string) {
171+
a.search.OnChanged = func(_ string) {
172172
a.filterRowsAsync(-1)
173173
}
174174
a.search.PlaceHolder = "Search characters and systems"
@@ -215,7 +215,7 @@ func NewOverview(u ui) *Overview {
215215
a.u.Signals().CharacterRemoved.AddListener(func(ctx context.Context, _ *app.EntityShort) {
216216
a.Update(ctx)
217217
})
218-
a.u.Signals().TagsChanged.AddListener(func(ctx context.Context, s struct{}) {
218+
a.u.Signals().TagsChanged.AddListener(func(ctx context.Context, _ struct{}) {
219219
a.Update(ctx)
220220
})
221221
a.u.Signals().CharacterSectionChanged.AddListener(func(ctx context.Context, arg app.CharacterSectionUpdated) {

internal/app/characterui/sendmail.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ func (w *eveEntityBadge) Cursor() desktop.Cursor {
399399
}
400400

401401
// MouseIn is a hook that is called if the mouse pointer enters the element.
402-
func (w *eveEntityBadge) MouseIn(e *desktop.MouseEvent) {
402+
func (w *eveEntityBadge) MouseIn(_ *desktop.MouseEvent) {
403403
if w.Disabled() {
404404
return
405405
}

0 commit comments

Comments
 (0)