Skip to content

fix: removed string concat in a loop is inefficient warning#1633

Open
corbinlazarone wants to merge 1 commit into
charmbracelet:mainfrom
corbinlazarone:fix-string-concat
Open

fix: removed string concat in a loop is inefficient warning#1633
corbinlazarone wants to merge 1 commit into
charmbracelet:mainfrom
corbinlazarone:fix-string-concat

Conversation

@corbinlazarone
Copy link
Copy Markdown

Summary

New users following the tutorial get "using string += string in a loop is inefficient" from the go lsp. I removed this warning by replacing the string concatenation with strings.builder go package.

  • I have read CONTRIBUTING.md.
  • I have created a discussion that was approved by a maintainer (for new features).

Copy link
Copy Markdown

@themavik themavik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes — the approach looks correct and follows the existing patterns in the codebase.

Copy link
Copy Markdown

@themavik themavik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Builder change is fine; this could still trip staticcheck if other examples/tutorials concatenate in a loop the same way, so worth grepping for the same pattern while you are here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants