Skip to content

Commit

Permalink
fix lint error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jguer committed Mar 23, 2024
1 parent 4e8a736 commit fafae75
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ linters:
# - funlen # TOFIX
- gochecknoinits
# - goconst # TOFIX
- gocritic
# - gocritic
# - gocyclo # TOFIX
- gofmt
- goimports
Expand Down
5 changes: 2 additions & 3 deletions callbacks_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"

alpm "github.com/Jguer/go-alpm/v2"
"github.com/stretchr/testify/require"
)

type Cnt struct {
Expand All @@ -27,7 +28,5 @@ func TestCallbacks(t *testing.T) {

h.Release()

if cnt.cnt != 1 {
panic(nil)
}
require.Equal(t, 1, cnt.cnt)
}
2 changes: 1 addition & 1 deletion db.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (db *DB) Search(targets []string) IPackageList {
needles = C.alpm_list_add(needles, unsafe.Pointer(C.CString(str)))
}

ok := C.alpm_db_search(db.ptr, needles, &ret) //nolint
ok := C.alpm_db_search(db.ptr, needles, &ret)
if ok != 0 {
return PackageList{nil, db.handle}
}
Expand Down
7 changes: 2 additions & 5 deletions package_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ package alpm_test

import (
"bytes"
"fmt"
"testing"
"text/template"
"time"

alpm "github.com/Jguer/go-alpm/v2"
"github.com/stretchr/testify/assert"
)

// Auxiliary formatting
Expand Down Expand Up @@ -59,10 +59,7 @@ func (p PrettyPackage) PrettyInstallDate() string {
func TestPkginfo(t *testing.T) {
t.Parallel()
pkginfoTemp, er := template.New("info").Parse(pkginfoTemplate)
if er != nil {
fmt.Printf("couldn't compile template: %s\n", er)
panic("template parsing error")
}
assert.NoError(t, er, "couldn't compile template")

h, er := alpm.Initialize(root, dbpath)
defer h.Release()
Expand Down

0 comments on commit fafae75

Please sign in to comment.