Skip to content

Commit 241c10a

Browse files
修复测试
1 parent d74e356 commit 241c10a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/core/dummy.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package core
22

33
import (
44
"bytes"
5+
"context"
56
"io"
67
"mime"
78
"net/http"
@@ -28,7 +29,7 @@ func NewDummy() (*ProviderDummy, error) {
2829
}, nil
2930
}
3031

31-
func (p *ProviderDummy) Repos(owner string) (map[string]string, error) {
32+
func (p *ProviderDummy) Repos(ctx context.Context, owner string) (map[string]string, error) {
3233
dir, err := os.ReadDir(filepath.Join(p.BaseDir, owner))
3334
if err != nil {
3435
return nil, err
@@ -42,7 +43,7 @@ func (p *ProviderDummy) Repos(owner string) (map[string]string, error) {
4243
return repos, nil
4344
}
4445

45-
func (p *ProviderDummy) Branches(owner, repo string) (map[string]*core.BranchInfo, error) {
46+
func (p *ProviderDummy) Branches(ctx context.Context, owner, repo string) (map[string]*core.BranchInfo, error) {
4647
dir, err := os.ReadDir(filepath.Join(p.BaseDir, owner, repo))
4748
if err != nil {
4849
return nil, err
@@ -59,7 +60,7 @@ func (p *ProviderDummy) Branches(owner, repo string) (map[string]*core.BranchInf
5960
return branches, nil
6061
}
6162

62-
func (p *ProviderDummy) Open(_ *http.Client, owner, repo, commit, path string, _ http.Header) (*http.Response, error) {
63+
func (p *ProviderDummy) Open(ctx context.Context, _ *http.Client, owner, repo, commit, path string, _ http.Header) (*http.Response, error) {
6364
open, err := os.Open(filepath.Join(p.BaseDir, owner, repo, commit, path))
6465
if err != nil {
6566
return nil, err

0 commit comments

Comments
 (0)