From 241c10afea08f4aab0f9601377ff2933c32605ed Mon Sep 17 00:00:00 2001 From: dragon Date: Mon, 18 Aug 2025 16:40:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/core/dummy.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/core/dummy.go b/tests/core/dummy.go index 3ec396c..4ab3f0b 100644 --- a/tests/core/dummy.go +++ b/tests/core/dummy.go @@ -2,6 +2,7 @@ package core import ( "bytes" + "context" "io" "mime" "net/http" @@ -28,7 +29,7 @@ func NewDummy() (*ProviderDummy, error) { }, nil } -func (p *ProviderDummy) Repos(owner string) (map[string]string, error) { +func (p *ProviderDummy) Repos(ctx context.Context, owner string) (map[string]string, error) { dir, err := os.ReadDir(filepath.Join(p.BaseDir, owner)) if err != nil { return nil, err @@ -42,7 +43,7 @@ func (p *ProviderDummy) Repos(owner string) (map[string]string, error) { return repos, nil } -func (p *ProviderDummy) Branches(owner, repo string) (map[string]*core.BranchInfo, error) { +func (p *ProviderDummy) Branches(ctx context.Context, owner, repo string) (map[string]*core.BranchInfo, error) { dir, err := os.ReadDir(filepath.Join(p.BaseDir, owner, repo)) if err != nil { return nil, err @@ -59,7 +60,7 @@ func (p *ProviderDummy) Branches(owner, repo string) (map[string]*core.BranchInf return branches, nil } -func (p *ProviderDummy) Open(_ *http.Client, owner, repo, commit, path string, _ http.Header) (*http.Response, error) { +func (p *ProviderDummy) Open(ctx context.Context, _ *http.Client, owner, repo, commit, path string, _ http.Header) (*http.Response, error) { open, err := os.Open(filepath.Join(p.BaseDir, owner, repo, commit, path)) if err != nil { return nil, err