Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit2bb3f88

Browse files
committed
Remove test that can panic
1 parentd4a0764 commit2bb3f88

File tree

2 files changed

+1
-15
lines changed

2 files changed

+1
-15
lines changed

‎pkg/github/repository_resource.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ func RepositoryResourceContentsHandler(getClient GetClientFn) func(ctx context.C
201201
}
202202
}
203203

204+
// This should be unreachable because GetContents should return an error if neither file nor directory content is found.
204205
returnnil,errors.New("no repository resource content found")
205206
}
206207
}

‎pkg/github/repository_resource_test.go

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,6 @@ func Test_repositoryResourceContentsHandler(t *testing.T) {
180180
},
181181
expectedResult:expectedDirContent,
182182
},
183-
{
184-
name:"no data",
185-
mockedClient:mock.NewMockedHTTPClient(
186-
mock.WithRequestMatch(
187-
mock.GetReposContentsByOwnerByRepoByPath,
188-
),
189-
),
190-
requestArgs:map[string]any{
191-
"owner": []string{"owner"},
192-
"repo": []string{"repo"},
193-
"path": []string{"src"},
194-
},
195-
expectedResult:nil,
196-
expectError:"no repository resource content found",
197-
},
198183
{
199184
name:"empty data",
200185
mockedClient:mock.NewMockedHTTPClient(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp