Golangci unparam linter not working in VS code

88 views Asked by At

I have enabled unparam linter in my config but its not detecting any warnings for my code

This shows for unparam when I run golangci-lint linters:

Enabled by your configuration linters: unparam: Reports unused function parameters [fast: false, auto-fix: false]

Here's my config:

run:
  modules-download-mode: readonly

linters-settings:
  unparam:
    check-exported: true    # Check for exported functions

linters:
  disable-all: true
  enable:
    - unparam

My main.go file:

/ Example function with an unused parameter
func ExampleFunc(x int, y string) {
    fmt.Println(y)  // Using y, so it's not reported as unused
}

func main() {
    // Calling the function with only one argument
    myString:="Hello" 
    myInt:=42

    ExampleFunc(myInt,myString)
}

When i run golangci-lint run,it doesn't show any errors.My golangci version is 1.56.2 and os is Mac.

0

There are 0 answers