-
Notifications
You must be signed in to change notification settings - Fork 2
Switching to new implementation / non fork version of https://github.com/golang/term/pull/20 #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…allyAdd in AddToHistory()
…odd to add/expose something that isn't actually used/needed
7c04ad4
to
736980f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR switches from the forked term package to the official golang.org/x/term implementation while introducing a new history management approach using TermHistory.
- Replaces old history functions with a new TermHistory struct and corresponding methods.
- Updates the Open function and history API calls in terminal.go.
- Introduces a new panic command in the demo and modifies benchmark loops in tests.
Reviewed Changes
Copilot reviewed 6 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
terminal.go | Migrates to golang.org/x/term and refactors history management. |
example/main.go | Adds a panic command and updates terminal closure logging. |
ansipixels/ansipixels.go | Updates term import to golang.org/x/term. |
ansipixels/ansiclean_test.go | Changes benchmark loop iteration method. |
README.md | Updates documentation to reflect switching to golang.org/x/term. |
Files not reviewed (2)
- Makefile: Language not supported
- go.mod: Language not supported
@@ -135,7 +135,7 @@ func TestAnsiCleanHR(t *testing.T) { | |||
func BenchmarkAnsiCleanRE(b *testing.B) { | |||
for _, tc := range testCases { | |||
b.Run(tc.name, func(b *testing.B) { | |||
for i := 0; i < b.N; i++ { | |||
for range b.N { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using 'for range b.N' is invalid because b.N is an integer. Use a standard for loop such as 'for i := 0; i < b.N; i++ {' instead.
for range b.N { | |
for i := 0; i < b.N; i++ { |
Copilot uses AI. Check for mistakes.
For golang/term#20 / updated golang/go#68780
Note the Add/UnconditionallyAdd is a bit awkward