Skip to content

Commit

Permalink
gitbase: fix linter errors
Browse files Browse the repository at this point in the history
Signed-off-by: Javi Fontan <[email protected]>
  • Loading branch information
jfontan committed Jun 20, 2019
1 parent 2c1a0d6 commit 044094c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
15 changes: 11 additions & 4 deletions common_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,15 @@ func newMultiLibrary() (*multiLibrary, error) {
}

libs := libraries.New(libraries.Options{})
libs.Add(plainLib)
libs.Add(sivaLib)

err = libs.Add(plainLib)
if err != nil {
return nil, err
}
err = libs.Add(sivaLib)
if err != nil {
return nil, err
}

return &multiLibrary{
lib: libs,
Expand Down Expand Up @@ -465,8 +472,8 @@ func copyFile(

_, err = io.Copy(fd, fo)
if err != nil {
fd.Close()
dstFS.Remove(dst)
_ = fd.Close()
_ = dstFS.Remove(dst)
return err
}

Expand Down
3 changes: 2 additions & 1 deletion repositories_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ func TestRepositoriesTable(t *testing.T) {

path := fixtures.Basic().ByTag("worktree").One().Worktree().Root()
for _, id := range repoIDs {
lib.AddPlain(id, path, nil)
err = lib.AddPlain(id, path, nil)
require.NoError(err)
}

session := NewSession(pool)
Expand Down
6 changes: 4 additions & 2 deletions repository_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,10 @@ func TestRepositoryPoolIterator(t *testing.T) {
require.NoError(err)

pool := NewRepositoryPool(cache.DefaultMaxSize, lib)
lib.AddPlain("0", path, nil)
lib.AddPlain("1", path, nil)
err = lib.AddPlain("0", path, nil)
require.NoError(err)
err = lib.AddPlain("1", path, nil)
require.NoError(err)

iter, err := pool.RepoIter()
require.NoError(err)
Expand Down
3 changes: 2 additions & 1 deletion squash_iterator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,8 @@ func setupIterWithErrors(t *testing.T, badRepo bool, skipErrors bool) (*sql.Cont
ok, err := IsGitRepo(path)
require.NoError(err)
if ok {
lib.AddPlain(pathToName(path), path, nil)
err = lib.AddPlain(pathToName(path), path, nil)
require.NoError(err)
}
}

Expand Down

0 comments on commit 044094c

Please sign in to comment.