Skip to content
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
14 changes: 7 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: set up go 1.22
uses: actions/setup-go@v4
- name: checkout
uses: actions/checkout@v4

- name: set up go
uses: actions/setup-go@v5
with:
go-version: "1.22"
id: go

- name: checkout
uses: actions/checkout@v3

- name: build and test
run: |
go get -v
Expand All @@ -30,9 +30,9 @@ jobs:
TZ: "America/Chicago"

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
uses: golangci/golangci-lint-action@v7
with:
version: v1.61
version: v2.6

- name: install goveralls
run: go install github.com/mattn/goveralls@latest
Expand Down
181 changes: 85 additions & 96 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,103 +1,92 @@
linters-settings:
govet:
shadow: true
golint:
min-confidence: 0.6
gocyclo:
min-complexity: 15
maligned:
suggest-new: true
dupl:
threshold: 100
goconst:
min-len: 2
min-occurrences: 2
misspell:
locale: US
lll:
line-length: 140
gocritic:
enabled-tags:
- performance
- style
- experimental
disabled-checks:
- wrapperFunc
- hugeParam
- rangeValCopy

version: "2"
run:
concurrency: 4
linters:
disable-all: true
default: none
enable:
- revive
- govet
- unconvert
- gosec
- unparam
- unused
- typecheck
- ineffassign
- stylecheck
- gochecknoinits
- gocritic
- gosec
- govet
- ineffassign
- nakedret
- gosimple
- prealloc
- revive
- staticcheck
- unconvert
- unparam
- unused
settings:
goconst:
min-len: 2
min-occurrences: 2
gocritic:
disabled-checks:
- wrapperFunc
- hugeParam
- rangeValCopy
enabled-tags:
- performance
- style
- experimental
gocyclo:
min-complexity: 15
govet:
enable-all: true
disable:
- fieldalignment
lll:
line-length: 140
misspell:
locale: US

fast: false


run:
concurrency: 4

issues:
exclude-dirs:
- vendor
exclude-rules:
- text: "should have a package comment, unless it's in another file for this package"
linters:
- golint
- text: "exitAfterDefer:"
linters:
- gocritic
- text: "whyNoLint: include an explanation for nolint directive"
linters:
- gocritic
- text: "go.mongodb.org/mongo-driver/bson/primitive.E"
linters:
- govet
- text: "weak cryptographic primitive"
linters:
- gosec
- text: "integer overflow conversion"
linters:
- gosec
- text: "should have a package comment"
linters:
- revive
- text: "at least one file in a package should have a package comment"
linters:
- stylecheck
- text: "commentedOutCode: may want to remove commented-out code"
linters:
- gocritic
- text: "unnamedResult: consider giving a name to these results"
linters:
- gocritic
- text: "var-naming: don't use an underscore in package name"
linters:
- revive
- text: "should not use underscores in package names"
linters:
- stylecheck
- text: "struct literal uses unkeyed fields"
linters:
- govet
- linters:
- unparam
- unused
- revive
path: _test\.go$
text: "unused-parameter"
exclude-use-default: false

exclusions:
generated: lax
rules:
- linters:
- gocritic
text: "exitAfterDefer:"
- linters:
- gocritic
text: "whyNoLint: include an explanation for nolint directive"
- linters:
- govet
text: "go.mongodb.org/mongo-driver/bson/primitive.E"
- linters:
- gosec
text: "weak cryptographic primitive"
- linters:
- gosec
text: "integer overflow conversion"
- linters:
- revive
text: "should have a package comment"
- linters:
- staticcheck
text: "at least one file in a package should have a package comment"
- linters:
- gocritic
text: "commentedOutCode: may want to remove commented-out code"
- linters:
- gocritic
text: "unnamedResult: consider giving a name to these results"
- linters:
- revive
text: "var-naming: don't use an underscore in package name"
- linters:
- staticcheck
text: "should not use underscores in package names"
- linters:
- govet
text: "struct literal uses unkeyed fields"
- linters:
- unparam
- unused
- revive
path: _test\.go$
text: "unused-parameter"
paths:
- vendor
- third_party$
- builtin$
- examples$
2 changes: 1 addition & 1 deletion sizedgroup.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type SizedGroup struct {
// NewSizedGroup makes wait group with limited size alive goroutines
func NewSizedGroup(size int, opts ...GroupOption) *SizedGroup {
res := SizedGroup{sema: NewSemaphore(size)}
res.options.ctx = context.Background()
res.ctx = context.Background()
for _, opt := range opts {
opt(&res.options)
}
Expand Down
Loading