Skip to content

Conversation

@aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Aug 26, 2025

Enable the gocritic linter, and fix issues.

Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 requested a review from Copilot August 26, 2025 16:38
Copy link
Contributor

Copilot AI left a 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 enables the gocritic linter by uncommenting it in the .golangci.yml configuration file and fixes various code style issues identified by the linter.

  • Enables the gocritic linter in the configuration
  • Replaces if-else chains with switch statements for better readability
  • Simplifies assignments and removes unnecessary operations

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.golangci.yml Uncomments the gocritic linter to enable it
model/value.go Replaces if-else chain with switch statement in MarshalJSON
model/time.go Simplifies string concatenation assignment
model/metric.go Converts multiple if-else chains to switch statements
expfmt/text_parse.go Replaces if-else chain with switch statement
expfmt/openmetrics_create.go Simplifies assignment and removes unnecessary pointer dereference
config/http_config_test.go Converts if-else chain to switch statement
config/http_config.go Removes unnecessary slice operations on byte arrays

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@aknuds1 aknuds1 requested review from bwplotka and ywwg August 26, 2025 16:41
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 merged commit ff65168 into main Aug 27, 2025
9 checks passed
@aknuds1 aknuds1 deleted the arve/gocritic branch August 27, 2025 04:57
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.

3 participants