Skip to content
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
30 changes: 27 additions & 3 deletions .github/workflows/codetests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ jobs:
os: [ubuntu, macos, windows]
runs-on: ${{ matrix.os }}-latest
steps:
- uses: actions/checkout@v6
- name: checkout PR head (pull_request_target)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v6
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
- name: checkout branch (push)
if: github.event_name == 'push'
uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
Expand All @@ -32,7 +40,15 @@ jobs:
env:
GOOS: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: checkout PR head (pull_request_target)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v6
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
- name: checkout branch (push)
if: github.event_name == 'push'
uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
Expand All @@ -53,7 +69,15 @@ jobs:
env:
GOOS: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: checkout PR head (pull_request_target)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v6
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.sha }}
- name: checkout branch (push)
if: github.event_name == 'push'
uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: 'stable'
Expand Down
17 changes: 10 additions & 7 deletions pkg/ui/dlgs.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@
}

// Error wraps an error dialog.
func Error(title, msg string, v ...any) (bool, error) {
func Error(title, msg string, args ...any) (bool, error) {
if !HasGUI() {
return true, nil
}

return dialogResult(zenity.Error(fmt.Sprintf(msg, v...), zenity.Title(title)))
return dialogResult(zenity.Error(fmt.Sprintf(msg, args...), zenity.Title(title)))
}

// Info wraps an info dialog.
func Info(title, msg string, v ...any) (bool, error) {
func Info(title, msg string, args ...any) (bool, error) {
if !HasGUI() {
return true, nil
}

return dialogResult(zenity.Info(fmt.Sprintf(msg, v...), zenity.Title(title)))
return dialogResult(zenity.Info(fmt.Sprintf(msg, args...), zenity.Title(title)))
}

// Entry wraps a text-entry dialog.
Expand All @@ -54,12 +54,15 @@
if errors.Is(err, zenity.ErrCanceled) {
return val, false, nil
}
if err != nil {
return entry, false, fmt.Errorf("zenity entry: %w", err)

Check failure on line 58 in pkg/ui/dlgs.go

View workflow job for this annotation

GitHub Actions / golangci-lint (windows)

error returned from external package is unwrapped: sig: func github.com/ncruces/zenity.Entry(text string, options ...github.com/ncruces/zenity.Option) (string, error) (wrapcheck)

Check failure on line 58 in pkg/ui/dlgs.go

View workflow job for this annotation

GitHub Actions / golangci-lint (darwin)

error returned from external package is unwrapped: sig: func github.com/ncruces/zenity.Entry(text string, options ...github.com/ncruces/zenity.Option) (string, error) (wrapcheck)
}

return entry, err == nil, err
return entry, true, nil
}

Check failure on line 62 in pkg/ui/dlgs.go

View workflow job for this annotation

GitHub Actions / golangci-lint (windows)

parameter name 'v' is too short for the scope of its usage (varnamelen)

Check failure on line 62 in pkg/ui/dlgs.go

View workflow job for this annotation

GitHub Actions / golangci-lint (darwin)

parameter name 'v' is too short for the scope of its usage (varnamelen)

// Question wraps a question dialog.
func Question(title string, defaultCancel bool, text string, v ...any) (bool, error) {
func Question(title string, defaultCancel bool, text string, args ...any) (bool, error) {
if !HasGUI() {
return true, nil
}
Expand All @@ -69,5 +72,5 @@
opts = append(opts, zenity.DefaultCancel())
}

return dialogResult(zenity.Question(fmt.Sprintf(text, v...), opts...))
return dialogResult(zenity.Question(fmt.Sprintf(text, args...), opts...))
}
Loading