Skip to content

fix: use modern golang functions (go fix)#991

Merged
burningalchemist merged 1 commit intomasterfrom
fix/gofixes
May 3, 2026
Merged

fix: use modern golang functions (go fix)#991
burningalchemist merged 1 commit intomasterfrom
fix/gofixes

Conversation

@burningalchemist
Copy link
Copy Markdown
Owner

This pull request introduces several improvements and code modernizations across the codebase, focusing on simplifying code, improving type usage, and leveraging newer Go standard library features. The main areas affected are utility functions, type definitions, duplicate label checking logic, and goroutine management.

Code Modernization and Type Improvements:

  • Replaced the use of interface{} with any in the LogFunc type and its method to align with modern Go conventions, making the code more idiomatic.

Logic Simplification and Use of Standard Library:

  • Updated duplicate label checking in MetricConfig.validateKeyLabels to use slices.Contains instead of a manual loop, simplifying the logic and improving readability. [1] [2]

Utility and Concurrency Enhancements:

  • Changed the splitting of the Accept-Encoding header to use strings.SplitSeq (likely a custom or newer function) and fixed the iteration method for improved correctness and clarity in decorateWriter.
  • Modernized goroutine management in the Warmup.Run method by replacing manual sync.WaitGroup management with the more concise cwg.Go pattern, reducing boilerplate and potential errors.

@burningalchemist burningalchemist merged commit 5274831 into master May 3, 2026
4 checks passed
@burningalchemist burningalchemist deleted the fix/gofixes branch May 3, 2026 10:46
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