refactor: address linter warnings, apply gopls recommendations #787
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.
This pull request introduces improvements to code readability, functionality, and documentation across several files in the project. Key changes include adding package-level comments, improving code clarity by replacing nested loops with utility functions, and ensuring consistent naming conventions.
Documentation Enhancements:
config/config.go
andexporter.go
to provide an overview of the functionality and purpose of the respective packages. ([[1]](https://github.com/burningalchemist/sql_exporter/pull/787/files#diff-fe44f09c4d5977b5f5eaea29170b6a0748819c9d02271746a20d81a5f3efca17R1-R2)
,[[2]](https://github.com/burningalchemist/sql_exporter/pull/787/files#diff-e4987a222ab3e846614998485952d8ee42288062a30929290cf3ea0e815d5ae1R1-R12)
)Code Simplifications:
slices.Contains
utility function to simplify duplicate checks inconfig/util.go
and target filtering inexporter.go
. ([[1]](https://github.com/burningalchemist/sql_exporter/pull/787/files#diff-9330cd3477bf68add7a143059fefbe02e5664d5b83b8fd5c7ebf2d1c3921a200L16-L21)
,[[2]](https://github.com/burningalchemist/sql_exporter/pull/787/files#diff-e4987a222ab3e846614998485952d8ee42288062a30929290cf3ea0e815d5ae1L186-L190)
)Naming Consistency:
config/util.go
to follow camelCase conventions (e.g.,cref_resolved
tocrefResolved
) for better readability and consistency. ([[1]](https://github.com/burningalchemist/sql_exporter/pull/787/files#diff-9330cd3477bf68add7a143059fefbe02e5664d5b83b8fd5c7ebf2d1c3921a200L31-R30)
,[[2]](https://github.com/burningalchemist/sql_exporter/pull/787/files#diff-9330cd3477bf68add7a143059fefbe02e5664d5b83b8fd5c7ebf2d1c3921a200L40-R42)
)Minor Improvements:
TrimMissingCtx
inexporter.go
to clarify its purpose and improve log context handling. ([exporter.goR243-L242](https://github.com/burningalchemist/sql_exporter/pull/787/files#diff-e4987a222ab3e846614998485952d8ee42288062a30929290cf3ea0e815d5ae1R243-L242)
)AwsSecret
struct inconfig/target_config.go
to provide a more descriptive explanation of its role. ([config/target_config.goL60-R60](https://github.com/burningalchemist/sql_exporter/pull/787/files#diff-0cc31906e1b4e1346602ee8a16ea22747c7640fa8a2760f9b269d40ead6ec5feL60-R60)
)