Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #2587
/channels
にpath
パラメーターをつけたときの動作を修正した.404 NotFound
を返すようにした.path
パラメーターが無いときと同になるようにした./channels?path=
のテストを追加した.Summary by Copilot
This pull request includes several changes to the
router/v3/channels.go
file to improve the handling of channel paths and error responses, as well as updates to the corresponding tests. The most important changes include adding error handling for invalid channel paths, modifying the response structure, and enhancing the test coverage for these scenarios.Error Handling Improvements:
GetChannels
function, returning a404 Not Found
status when the path is invalid.Response Structure Modifications:
GetChannels
function to properly format channels and include subchannels in the response. [1] [2]Test Coverage Enhancements:
CreateSubchannel
inrouter_test.go
to create subchannels for testing purposes.TestHandlers_GetChannels
test function to include checks for subchannels and validate the new error handling for invalid paths. [1] [2] [3] [4] [5]These changes ensure that the channel handling logic is more robust and that the test suite accurately reflects the new behavior.