1
0
mirror of https://github.com/go-kratos/kratos.git synced 2025-03-17 21:07:54 +02:00

use "and" replace "sub" (#1207)

This commit is contained in:
拉小轰 2021-07-18 15:01:08 +08:00 committed by GitHub
parent 2920c12ead
commit 5d07a94b16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,7 +32,7 @@ func (l *stdLogger) Log(level Level, keyvals ...interface{}) error {
if len(keyvals) == 0 {
return nil
}
if len(keyvals)%2 != 0 {
if (len(keyvals) & 1) == 1 {
keyvals = append(keyvals, "KEYVALS UNPAIRED")
}
buf := l.pool.Get().(*bytes.Buffer)