Remove unnecessary []byte casts in pkg/console golden tests#24086
Merged
Remove unnecessary []byte casts in pkg/console golden tests#24086
[]byte casts in pkg/console golden tests#24086Conversation
4 tasks
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/df7a6499-5c6b-4723-8c38-50cb36fabb01 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Remove unnecessary []byte casts in golden tests
Remove unnecessary Apr 2, 2026
[]byte casts in pkg/console golden tests
Contributor
There was a problem hiding this comment.
Pull request overview
This PR simplifies pkg/console golden tests by removing redundant []byte(...) casts and passing string outputs directly to golden.RequireEqual, avoiding unnecessary conversions/allocations at the call sites.
Changes:
- Updated 6
golden.RequireEqualcall sites to passstringvalues directly instead of[]byte(...)casts.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
golden.RequireEqualis generic over[]byte | string, but all call sites inpkg/console/golden_test.gowere converting strings to[]bytebefore passing them — causing needless allocations with no benefit.Changes
pkg/console/golden_test.go: Removed 6[]byte(...)casts, passingstringvalues directly togolden.RequireEqual