Skip to content

Default concurrency is NumCPU, not 4 #23

@ryboe

Description

@ryboe

I was confused by this section of the --help text. I wondered why concurrency was defaulting to 4, instead of using runtime.NumCPU() to scale the number of workers to the user's actual number of cores.

Flags:
  -j, --concurrency int           Concurrency (default 4)

Apparently, you are doing this 😀👍

rootCmd.PersistentFlags().IntVarP(&e.cfg.Run.Concurrency, "concurrency", "j", runtime.NumCPU(), "Concurrency")

https://github.com/golangci/golangci-lint/blob/master/pkg/commands/root.go#L64

I think the --help text should be updated to Concurrency (default NumCPU) or similar. Go programmers will recognize NumCPU as runtime.NumCPU().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions