Skip to content

Commit 6f517e4

Browse files
committed
migrate to github actions
1 parent 71308bc commit 6f517e4

File tree

2 files changed

+25
-13
lines changed

2 files changed

+25
-13
lines changed

.golangci.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,49 @@
11
output:
2-
format: tab
2+
formats:
3+
- format: tab
34
linters:
45
disable-all: true
56
enable:
6-
- deadcode
77
- depguard
88
- dupl
99
- goconst
1010
- gocritic
1111
- gocyclo
1212
- gofmt
1313
- goimports
14-
- golint
14+
- revive
1515
- gosec
1616
- govet
1717
- ineffassign
18-
- maligned
1918
- misspell
2019
- prealloc
21-
- scopelint
22-
- structcheck
20+
- copyloopvar
21+
- unused
2322
- typecheck
2423
- unconvert
25-
- varcheck
2624
issues:
2725
exclude-use-default: false
28-
max-per-linter: 0
26+
max-issues-per-linter: 0
2927
max-same-issues: 0
3028
exclude-rules:
3129
- path: _test\.go
3230
linters:
31+
- revive
3332
- dupl
3433
- scopelint
34+
35+
# golangci-lint config
36+
linters-settings:
37+
depguard:
38+
rules:
39+
prevent_unmaintained_packages:
40+
list-mode: lax # allow unless explicitely denied
41+
files:
42+
- $all
43+
- "!$test"
44+
allow:
45+
- $gostd
46+
deny:
47+
- pkg: io/ioutil
48+
desc: "replaced by io and os packages since Go 1.16: https://tip.golang.org/doc/go1.16#ioutil"
49+

producer.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,8 @@ func (p *Producer) Enqueue(ctx context.Context, msg *Message) error {
8181
ID: msg.ID,
8282
Stream: msg.Stream,
8383
Values: msg.Values,
84-
}
85-
if p.options.ApproximateMaxLength {
86-
args.MaxLen = p.options.StreamMaxLength
87-
} else {
88-
args.MaxLen = p.options.StreamMaxLength
84+
MaxLen: p.options.StreamMaxLength,
85+
Approx: p.options.ApproximateMaxLength,
8986
}
9087
id, err := p.redis.XAdd(ctx, args).Result()
9188
if err != nil {

0 commit comments

Comments
 (0)