Skip to content

Commit

Permalink
Fix golangci-lint problem
Browse files Browse the repository at this point in the history
  • Loading branch information
RashadAnsari committed Apr 11, 2022
1 parent 20df687 commit 8bbe7d7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
with:
go-version: 1.18
- name: Install golangci-lint
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.40.1
run: curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh| sh -s -- -b $(go env GOPATH)/bin v1.45.2
- name: Lint
run: make lint

Expand Down
6 changes: 3 additions & 3 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ linters:
disable-all: true
enable:
- gofmt
- bodyclose
- gosimple
# - bodyclose
# - gosimple
- prealloc
- unused
# - unused
- errcheck
- deadcode
- govet
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ format:
@find . -type f -name '*.go' -not -path './vendor/*' -exec goimports -w -local github.com/RashadAnsari {} +

lint:
@#golangci-lint -c .golangci.yml run ./...
@echo "golangci-lint does not support go1.18 yet!"
@golangci-lint -c .golangci.yml run ./...

test:
@go test -v -race -p 1 ./...
Expand Down
10 changes: 2 additions & 8 deletions batch.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,10 @@ func New[T any](optionFuncs ...OptionFunc) *Batch[T] {
input := make(chan T)
output := make(chan []T)

oneWayInput := make(chan<- T)
oneWayOutput := make(<-chan []T)

oneWayInput = input
oneWayOutput = output

b := &Batch[T]{
opts: opts,
Input: oneWayInput,
Output: oneWayOutput,
Input: input,
Output: output,
}

go b.processor(input, output)
Expand Down

0 comments on commit 8bbe7d7

Please sign in to comment.