Skip to content

Commit

Permalink
Update to golangci-lint v1.56.1; fix lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
richardwilkes committed Feb 10, 2024
1 parent 7430694 commit fc07fa7
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -eo pipefail

trap 'echo -e "\033[33;5mBuild failed on build.sh:$LINENO\033[0m"' ERR

GOLANGCI_LINT_VERSION=1.55.2
GOLANGCI_LINT_VERSION=1.56.1

for arg in "$@"
do
Expand Down
2 changes: 1 addition & 1 deletion example/demo/demo.go
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,7 @@ func createImagePanel() *unison.Label {
Y: size.Height / 2,
})
}
imgPanel.UpdateCursorCallback = func(where unison.Point) *unison.Cursor { return cursor }
imgPanel.UpdateCursorCallback = func(_ unison.Point) *unison.Cursor { return cursor }

// Add a tooltip that shows the current mouse coordinates
imgPanel.UpdateTooltipCallback = func(where unison.Point, suggestedAvoidInRoot unison.Rect) unison.Rect {
Expand Down
2 changes: 1 addition & 1 deletion example/demo/demo_row.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func (d *demoRow) ColumnCell(row, col int, foreground, _ unison.Ink, _, _, _ boo
addWrappedText(wrapper, "A little note…", foreground,
unison.LabelFont.Face().Font(unison.LabelFont.Size()-1), width)
}
wrapper.UpdateTooltipCallback = func(where unison.Point, suggestedAvoidInRoot unison.Rect) unison.Rect {
wrapper.UpdateTooltipCallback = func(_ unison.Point, _ unison.Rect) unison.Rect {
wrapper.Tooltip = unison.NewTooltipWithText("A tooltip for the cell")
return wrapper.RectToRoot(wrapper.ContentRect(true))
}
Expand Down
2 changes: 1 addition & 1 deletion gen/enumgen.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ func main() {
func removeExistingGenFiles() {
root, err := filepath.Abs(rootDir)
fatal.IfErr(err)
fatal.IfErr(filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
fatal.IfErr(filepath.Walk(root, func(path string, info os.FileInfo, _ error) error {
name := info.Name()
if info.IsDir() {
if name == ".git" {
Expand Down
10 changes: 5 additions & 5 deletions link.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ func NewLink(title, tooltip, target string, theme LinkTheme, clickHandler func(P
if tooltip != "" {
link.Tooltip = NewTooltipWithText(tooltip)
}
link.UpdateCursorCallback = func(where Point) *Cursor {
link.UpdateCursorCallback = func(_ Point) *Cursor {
return PointingCursor()
}
link.MouseEnterCallback = func(where Point, mod Modifiers) bool {
link.MouseEnterCallback = func(_ Point, _ Modifiers) bool {
link.Text.AdjustDecorations(func(decoration *TextDecoration) {
decoration.Foreground = theme.RolloverInk
})
Expand All @@ -56,15 +56,15 @@ func NewLink(title, tooltip, target string, theme LinkTheme, clickHandler func(P
return true
}
in := false
link.MouseDownCallback = func(where Point, button, clickCount int, mod Modifiers) bool {
link.MouseDownCallback = func(_ Point, _, _ int, _ Modifiers) bool {
link.Text.AdjustDecorations(func(decoration *TextDecoration) {
decoration.Foreground = theme.PressedInk
})
link.MarkForRedraw()
in = true
return true
}
link.MouseDragCallback = func(where Point, button int, mod Modifiers) bool {
link.MouseDragCallback = func(where Point, _ int, _ Modifiers) bool {
now := where.In(link.ContentRect(true))
if now != in {
in = now
Expand All @@ -79,7 +79,7 @@ func NewLink(title, tooltip, target string, theme LinkTheme, clickHandler func(P
}
return true
}
link.MouseUpCallback = func(where Point, button int, mod Modifiers) bool {
link.MouseUpCallback = func(where Point, _ int, _ Modifiers) bool {
ink := theme.Foreground
inside := where.In(link.ContentRect(true))
if inside {
Expand Down
4 changes: 2 additions & 2 deletions popup_menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ func (p *PopupMenu[T]) Click() {

func (p *PopupMenu[T]) createMenuItem(m Menu, index int, entry *popupMenuItem[T]) MenuItem {
item := m.Factory().NewItem(PopupMenuTemporaryBaseID+index+1,
fmt.Sprintf("%v", entry.item), KeyBinding{}, func(mi MenuItem) bool {
fmt.Sprintf("%v", entry.item), KeyBinding{}, func(_ MenuItem) bool {
return entry.enabled
}, func(mi MenuItem) {
}, func(_ MenuItem) {
if p.ChoiceMadeCallback != nil {
p.ChoiceMadeCallback(p, index, p.items[index].item)
}
Expand Down
2 changes: 1 addition & 1 deletion printing/job_dialog.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ func (d *JobDialog) retrieveIcon() *unison.Image {

func (d *JobDialog) createCopies(parent *unison.Panel) {
d.copies = unison.NewNumericField(d.jobAttributes.Copies(), 1, d.printerAttributes.MaxCopies(), strconv.Itoa,
strconv.Atoi, func(minimum, maximum int) []int { return []int{maximum} })
strconv.Atoi, func(_, maximum int) []int { return []int{maximum} })
d.copies.ModifiedCallback = d.adjustOKButton
d.copies.SetLayoutData(&unison.FlexLayoutData{VAlign: align.Middle})

Expand Down
2 changes: 1 addition & 1 deletion window.go
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ func NewWindow(title string, options ...WindowOption) (*Window, error) {
delete(redrawSet, w)
w.draw()
})
w.wnd.SetPosCallback(func(_ *glfw.Window, xpos, ypos int) {
w.wnd.SetPosCallback(func(_ *glfw.Window, _, _ int) {
w.moved()
})
w.wnd.SetSizeCallback(func(_ *glfw.Window, width, height int) {
Expand Down

0 comments on commit fc07fa7

Please sign in to comment.