Skip to content

Commit ff0e607

Browse files
committed
update readme
1 parent b69af3f commit ff0e607

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

README.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# zerologlint
22
![build](https://github.com/ykadowak/zerologlint/actions/workflows/testing.yaml/badge.svg)
33

4-
`zerologlint` is a linter for [zerolog](https://github.com/rs/zerolog) that can be run with `go vet`.
5-
It detects the wrong usage of `zerolog` that a user forgets to dispatch `zerolog.Event` with `Send` or `Msg` like functions, in which case nothing will be logged. For more detailed explanations of the cases it detects, see [Example](#Example).
4+
`zerologlint` is a linter for [zerolog](https://github.com/rs/zerolog) that can be run with `go vet` or through [golangci-lint](https://golangci-lint.run/) since `v1.53.0`.
5+
It detects the wrong usage of `zerolog` that a user forgets to dispatch `zerolog.Event` with `Send` or `Msg` like functions, in which case nothing will be logged. For more detailed explanations of the cases it detects, see [Examples](#Example).
66

77
## Install
88

@@ -15,7 +15,9 @@ go install github.com/ykadowak/zerologlint/cmd/zerologlint@latest
1515
go vet -vettool=`which zerologlint` ./...
1616
```
1717

18-
## Example
18+
or you can also use it with [golangci-lint](https://golangci-lint.run/) since `v1.53.0`.
19+
20+
## Examples
1921
```go
2022
package main
2123

@@ -42,5 +44,8 @@ func main() {
4244
logger = log.Error() // "must be dispatched by Msg or Send method"
4345
}
4446
logger.Str("foo", "bar")
47+
48+
// 4. Deferred case
49+
defer log.Info() // "must be dispatched by Msg or Send method"
4550
}
4651
```

0 commit comments

Comments
 (0)