Skip to content

fix: resolve modernize lint errors in apply.go and table.go - #503

Merged
k1LoW merged 1 commit into
mainfrom
modernize
Mar 13, 2026
Merged

k1LoW merged 1 commit into
mainfrom
modernize

Conversation

@k1LoW

@k1LoW k1LoW commented Mar 13, 2026

Copy link
Copy Markdown
Owner

This pull request introduces several improvements to the codebase, focusing on performance optimizations and code modernization. The most significant changes include replacing inefficient string concatenation with strings.Builder for text assembly, updating table iteration patterns for clarity and safety, and adding a new linter to enforce modern coding practices.

Performance optimizations:

  • Replaced string concatenation with strings.Builder in apply.go for text assembly in both applyParagraphsRequests and updateLayout, improving memory efficiency and performance. [1] [2] [3] [4] [5] [6]

Code modernization:

  • Updated table iteration in table.go to use range loops instead of index-based loops, reducing potential off-by-one errors and aligning with Go best practices. [1] [2]
  • Added the modernize linter to .golangci.yml to encourage up-to-date Go coding standards.

@k1LoW k1LoW self-assigned this Mar 13, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Code Metrics Report

main (260a210) #503 (ba17930) +/-
Coverage 33.7% 33.7% 0.0%
Code to Test Ratio 1:0.9 1:0.9 0.0
Test Execution Time 10s 12s +2s
Details
  |                     | main (260a210) | #503 (ba17930) | +/-  |
  |---------------------|----------------|----------------|------|
  | Coverage            |          33.7% |          33.7% | 0.0% |
  |   Files             |             31 |             31 |    0 |
  |   Lines             |           3407 |           3407 |    0 |
  |   Covered           |           1151 |           1151 |    0 |
  | Code to Test Ratio  |          1:0.9 |          1:0.9 |  0.0 |
  |   Code              |           7022 |           7022 |    0 |
  |   Test              |           6581 |           6581 |    0 |
- | Test Execution Time |            10s |            12s |  +2s |

Code coverage of files in pull request scope (2.5% → 2.5%)

Files Coverage +/- Status
apply.go 1.4% 0.0% modified
table.go 4.2% 0.0% modified

Reported by octocov

@k1LoW
k1LoW merged commit 0aa67e7 into main Mar 13, 2026
1 check passed
@k1LoW
k1LoW deleted the modernize branch March 13, 2026 13:03
@github-actions github-actions Bot mentioned this pull request Mar 13, 2026
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.

1 participant

⌂ 换网址