Skip to content

Commit

Permalink
Fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
sachaos committed Oct 15, 2023
1 parent af7a4b8 commit 4c07af3
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ jobs:
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: v1.46.2
version: v1.51.2
args: -c .golang-ci.yml

10 changes: 10 additions & 0 deletions .golang-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,13 @@ linters:
- predeclared
- nilnil
- varnamelen
- nosnakecase
- varcheck
- interfacer
- structcheck
- golint
- scopelint
- deadcode
- ifshort
- rowserrcheck
- wastedassign
8 changes: 6 additions & 2 deletions viddy.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,14 @@ func (v *Viddy) diffQueueHandler() {
if v.skipEmptyDiffs {
v.addSnapshotToView(id, r)
}

r.addition.SetText("+" + strconv.Itoa(s.diffAdditionCount))
r.deletion.SetText("-" + strconv.Itoa(s.diffDeletionCount))
}()
}
}

//nolint:funlen,gocognit,cyclop
//nolint:funlen,cyclop
func (v *Viddy) queueHandler() {
for {
func() {
Expand Down Expand Up @@ -442,7 +443,8 @@ func (v *Viddy) arrange() {
}

// Run is entry point to run viddy.
// nolint: funlen,gocognit,cyclop
//
//nolint:funlen,gocognit,cyclop,gocyclo,maintidx
func (v *Viddy) Run() error {
b := tview.NewTextView()
b.SetDynamicColors(true)
Expand Down Expand Up @@ -664,10 +666,12 @@ func (v *Viddy) goToRow(row int) {
} else if count := v.historyView.GetRowCount(); row >= count {
row = count - 1
}

var (
cell = v.historyView.GetCell(row, 0)
id, err = strconv.ParseInt(cell.Text, 10, 64)
)

if err == nil { // if _no_ error
v.setSelection(id, row)
}
Expand Down

0 comments on commit 4c07af3

Please sign in to comment.