resolve linter issues
This commit is contained in:
@@ -12,7 +12,9 @@ import (
|
||||
)
|
||||
|
||||
func TestMain(m *testing.M) {
|
||||
loadStore()
|
||||
if err := loadStore(); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
||||
@@ -20,13 +22,17 @@ var (
|
||||
store = NewMapStorage()
|
||||
)
|
||||
|
||||
func loadStore() {
|
||||
func loadStore() error {
|
||||
for i := 0; i < 20; i++ {
|
||||
store.Store(process.ProcEntry{
|
||||
Pid: rand.Int(),
|
||||
if err := store.Store(process.ProcEntry{
|
||||
Pid: rand.Int(), //nolint:gosec
|
||||
Extension: fmt.Sprintf("extension-%s", strconv.Itoa(i)),
|
||||
})
|
||||
}); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func TestLoadAll(t *testing.T) {
|
||||
@@ -35,9 +41,10 @@ func TestLoadAll(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestDelete(t *testing.T) {
|
||||
store.Delete(process.ProcEntry{
|
||||
err := store.Delete(process.ProcEntry{
|
||||
Extension: "extension-1",
|
||||
})
|
||||
assert.Nil(t, err)
|
||||
all := store.LoadAll()
|
||||
assert.Zero(t, all["extension-1"])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user