Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: add constant and disable the gomnd linter #363

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ linters:
- gofumpt
- goheader
- goimports
# - gomnd
- gomoddirectives
- gomodguard
- goprintffuncname
Expand Down Expand Up @@ -169,6 +168,9 @@ linters:
# # Don't feel about chasing this one down
# - musttag

# More false positive than actual issues
- gomnd

# Run only fast linters from enabled linters set (first run won't be fast)
# Default: false
# fast: true
3 changes: 2 additions & 1 deletion crawler/crawler.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ type Crawler struct {
// NewCrawler initializes a new Crawler object and connects to Elasticsearch (if dryRun == false).
func NewCrawler(dryRun bool) *Crawler {
var c Crawler
const channelSize = 1000

c.DryRun = dryRun

Expand All @@ -53,7 +54,7 @@ func NewCrawler(dryRun bool) *Crawler {
}

// Initiate a channel of repositories.
c.repositories = make(chan common.Repository, 1000)
c.repositories = make(chan common.Repository, channelSize)

// Register Prometheus metrics.
metrics.RegisterPrometheusCounter("repository_processed", "Number of repository processed.", c.Index)
Expand Down
Loading