Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use Staticcheck v0.5.1 in CI infrastructure #5175

Merged
merged 4 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/license_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: WillAbides/setup-go-faster@v1.13.0
- uses: WillAbides/setup-go-faster@v1
with:
go-version: '1.21.x'
go-version: '1.23.x'

- name: Install lian
run: go install lucor.dev/lian@latest
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mobile_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: ['1.19.x', '1.21.x']
go-version: ['1.19.x', '1.23.x']

steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: WillAbides/setup-go-faster@v1.13.0
- uses: WillAbides/setup-go-faster@v1
with:
go-version: ${{ matrix.go-version }}

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/platform_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: ['1.19.x', '1.21.x']
go-version: ['1.19.x', '1.23.x']
os: [ubuntu-latest, macos-latest]
include:
- os: ubuntu-latest
Expand All @@ -21,7 +21,7 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: WillAbides/setup-go-faster@v1.13.0
- uses: WillAbides/setup-go-faster@v1
with:
go-version: ${{ matrix.go-version }}

Expand Down Expand Up @@ -51,12 +51,12 @@ jobs:
strategy:
fail-fast: false
matrix:
go-version: ['1.20.x', '1.21.x']
go-version: ['1.20.x', '1.22.x']
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: WillAbides/setup-go-faster@v1.13.0
- uses: WillAbides/setup-go-faster@v1
with:
go-version: ${{ matrix.go-version }}

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/static_analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: WillAbides/setup-go-faster@v1.13.0
- uses: WillAbides/setup-go-faster@v1
with:
go-version: '1.21.x'
go-version: '1.23.x'

- name: Get dependencies
run: >-
Expand All @@ -33,7 +33,7 @@ jobs:
run: |
go install golang.org/x/tools/cmd/goimports@latest
go install github.com/fzipp/gocyclo/cmd/gocyclo@latest
go install honnef.co/go/tools/cmd/staticcheck@v0.4.6
go install honnef.co/go/tools/cmd/staticcheck@v0.5.1
go install github.com/mattn/goveralls@latest

- name: Vet
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/web_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
with:
persist-credentials: false
- uses: WillAbides/setup-go-faster@v1.13.0
- uses: WillAbides/setup-go-faster@v1
with:
go-version: '1.19.x'

Expand Down
3 changes: 2 additions & 1 deletion cmd/fyne/internal/mobile/binres/binres_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"bytes"
"encoding"
"encoding/xml"
"errors"
"fmt"
"math"
"os"
Expand Down Expand Up @@ -246,7 +247,7 @@ func compareElements(have, want *XML) error {
}
}
if buf.Len() > 0 {
return fmt.Errorf(buf.String())
return errors.New(buf.String())
}
return nil
}
Expand Down
2 changes: 1 addition & 1 deletion widget/check_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ type checkGroupRenderer struct {
// Layout the components of the checks widget
func (r *checkGroupRenderer) Layout(_ fyne.Size) {
count := 1
if r.items != nil && len(r.items) > 0 {
if len(r.items) > 0 {
count = len(r.items)
}
var itemHeight, itemWidth float32
Expand Down
4 changes: 2 additions & 2 deletions widget/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func (l *List) scrollTo(id ListItemID) {
separatorThickness := l.Theme().Size(theme.SizeNamePadding)
y := float32(0)
lastItemHeight := l.itemMin.Height
if l.itemHeights == nil || len(l.itemHeights) == 0 {
if len(l.itemHeights) == 0 {
y = (float32(id) * l.itemMin.Height) + (float32(id) * separatorThickness)
} else {
for i := 0; i < id; i++ {
Expand Down Expand Up @@ -368,7 +368,7 @@ func (l *List) contentMinSize() fyne.Size {
}
items := l.Length()

if l.itemHeights == nil || len(l.itemHeights) == 0 {
if len(l.itemHeights) == 0 {
return fyne.NewSize(l.itemMin.Width,
(l.itemMin.Height+separatorThickness)*float32(items)-separatorThickness)
}
Expand Down
2 changes: 1 addition & 1 deletion widget/radio_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ type radioGroupRenderer struct {
// Layout the components of the radio widget
func (r *radioGroupRenderer) Layout(_ fyne.Size) {
count := 1
if r.items != nil && len(r.items) > 0 {
if len(r.items) > 0 {
count = len(r.items)
}
var itemHeight, itemWidth float32
Expand Down
Loading