From ff0e607007334f0e91940b4dc8236a379c6fb9cb Mon Sep 17 00:00:00 2001 From: "yusuke.kadowaki" Date: Mon, 5 Jun 2023 22:39:52 +0900 Subject: [PATCH] update readme --- README.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f904a62..14443e2 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ # zerologlint ![build](https://github.com/ykadowak/zerologlint/actions/workflows/testing.yaml/badge.svg) -`zerologlint` is a linter for [zerolog](https://github.com/rs/zerolog) that can be run with `go vet`. -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). +`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`. +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). ## Install @@ -15,7 +15,9 @@ go install github.com/ykadowak/zerologlint/cmd/zerologlint@latest go vet -vettool=`which zerologlint` ./... ``` -## Example +or you can also use it with [golangci-lint](https://golangci-lint.run/) since `v1.53.0`. + +## Examples ```go package main @@ -42,5 +44,8 @@ func main() { logger = log.Error() // "must be dispatched by Msg or Send method" } logger.Str("foo", "bar") + + // 4. Deferred case + defer log.Info() // "must be dispatched by Msg or Send method" } ```