aboutsummaryrefslogtreecommitdiffstats
path: root/common_test.go
diff options
context:
space:
mode:
authorAlberto Cortés <alberto@sourced.tech>2016-01-11 10:59:03 +0100
committerAlberto Cortés <alberto@sourced.tech>2016-01-11 11:43:51 +0100
commit6d19be9bdb355d2285138ead6cd487920b26fe99 (patch)
treead234af3bd3af78992944858abc2095b3199df44 /common_test.go
parentcebec78608e7913b8c843390237fd609069022ae (diff)
downloadgo-git-6d19be9bdb355d2285138ead6cd487920b26fe99.tar.gz
missing call to Close on Fetch return value (ReadCloser)
Diffstat (limited to 'common_test.go')
-rw-r--r--common_test.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/common_test.go b/common_test.go
index 44b76ee..f6e0f0c 100644
--- a/common_test.go
+++ b/common_test.go
@@ -15,6 +15,7 @@ func Test(t *testing.T) { TestingT(t) }
type MockGitUploadPackService struct {
Auth common.AuthMethod
+ RC io.ReadCloser
}
func (s *MockGitUploadPackService) Connect(url common.Endpoint) error {
@@ -40,8 +41,9 @@ func (s *MockGitUploadPackService) Info() (*common.GitUploadPackInfo, error) {
}
func (s *MockGitUploadPackService) Fetch(*common.GitUploadPackRequest) (io.ReadCloser, error) {
- r, _ := os.Open("formats/packfile/fixtures/git-fixture.ref-delta")
- return r, nil
+ var err error
+ s.RC, err = os.Open("formats/packfile/fixtures/git-fixture.ref-delta")
+ return s.RC, err
}
var fixtureRepos = [...]struct {