Skip to content

Commit 044094c

Browse files
committed
gitbase: fix linter errors
Signed-off-by: Javi Fontan <[email protected]>
1 parent 2c1a0d6 commit 044094c

File tree

4 files changed

+19
-8
lines changed

4 files changed

+19
-8
lines changed

common_test.go

+11-4
Original file line numberDiff line numberDiff line change
@@ -321,8 +321,15 @@ func newMultiLibrary() (*multiLibrary, error) {
321321
}
322322

323323
libs := libraries.New(libraries.Options{})
324-
libs.Add(plainLib)
325-
libs.Add(sivaLib)
324+
325+
err = libs.Add(plainLib)
326+
if err != nil {
327+
return nil, err
328+
}
329+
err = libs.Add(sivaLib)
330+
if err != nil {
331+
return nil, err
332+
}
326333

327334
return &multiLibrary{
328335
lib: libs,
@@ -465,8 +472,8 @@ func copyFile(
465472

466473
_, err = io.Copy(fd, fo)
467474
if err != nil {
468-
fd.Close()
469-
dstFS.Remove(dst)
475+
_ = fd.Close()
476+
_ = dstFS.Remove(dst)
470477
return err
471478
}
472479

repositories_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ func TestRepositoriesTable(t *testing.T) {
2626

2727
path := fixtures.Basic().ByTag("worktree").One().Worktree().Root()
2828
for _, id := range repoIDs {
29-
lib.AddPlain(id, path, nil)
29+
err = lib.AddPlain(id, path, nil)
30+
require.NoError(err)
3031
}
3132

3233
session := NewSession(pool)

repository_pool_test.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -108,8 +108,10 @@ func TestRepositoryPoolIterator(t *testing.T) {
108108
require.NoError(err)
109109

110110
pool := NewRepositoryPool(cache.DefaultMaxSize, lib)
111-
lib.AddPlain("0", path, nil)
112-
lib.AddPlain("1", path, nil)
111+
err = lib.AddPlain("0", path, nil)
112+
require.NoError(err)
113+
err = lib.AddPlain("1", path, nil)
114+
require.NoError(err)
113115

114116
iter, err := pool.RepoIter()
115117
require.NoError(err)

squash_iterator_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -785,7 +785,8 @@ func setupIterWithErrors(t *testing.T, badRepo bool, skipErrors bool) (*sql.Cont
785785
ok, err := IsGitRepo(path)
786786
require.NoError(err)
787787
if ok {
788-
lib.AddPlain(pathToName(path), path, nil)
788+
err = lib.AddPlain(pathToName(path), path, nil)
789+
require.NoError(err)
789790
}
790791
}
791792

0 commit comments

Comments
 (0)