KusionStack / karpor

Intelligence for Kubernetes. World's most promising Kubernetes Visualization Tool for Developer and Platform Engineering teams.
https://karpor-demo.kusionstack.io
Apache License 2.0
678 stars 52 forks source link

refactor: refine golangci-lint config and update dependencies #646

Closed elliotxx closed 1 week ago

elliotxx commented 2 weeks ago

What type of PR is this?

/kind refactor

What this PR does / why we need it:

This PR includes several code quality improvements and dependency updates:

  1. Code Quality Improvements:

    • Fix duplicate error check in elasticsearch client
    • Improve error handling in multiple packages
    • Fix linting issues and code style
    • Optimize imports organization
    • Use http.MethodGet instead of string literals
    • Fix potential nil pointer issues
    • Improve test cases and benchmarks
  2. Dependency Updates:

    • Upgrade Go version from 1.19 to 1.22
    • Update golangci-lint from v1.58.2 to v1.62.0
    • Upgrade golangci-lint-action from v2 to v6
    • Remove unused k8s.io dependencies (kube-aggregator, sample-apiserver)
  3. Configuration Updates:

    • Update golangci-lint configuration
    • Add new linters and rules
    • Disable contextcheck for server.go
    • Update make targets for better linting experience

Special notes