diff --git a/contrib/log/zap/zap.go b/contrib/log/zap/zap.go index 094e1e654..1ad8caed6 100644 --- a/contrib/log/zap/zap.go +++ b/contrib/log/zap/zap.go @@ -25,7 +25,7 @@ func (l *Logger) Log(level log.Level, keyvals ...interface{}) error { return nil } - var data []zap.Field = make([]zap.Field, 0, (keylen/2)+1) + data := make([]zap.Field, 0, (keylen/2)+1) for i := 0; i < keylen; i += 2 { data = append(data, zap.Any(fmt.Sprint(keyvals[i]), keyvals[i+1])) } diff --git a/transport/http/codec.go b/transport/http/codec.go index 156181f77..5aef7995c 100644 --- a/transport/http/codec.go +++ b/transport/http/codec.go @@ -4,7 +4,6 @@ import ( "bytes" "fmt" "io" - "io/ioutil" "net/http" "net/url" @@ -67,7 +66,7 @@ func DefaultRequestDecoder(r *http.Request, v interface{}) error { data, err := io.ReadAll(r.Body) // reset body. - r.Body = ioutil.NopCloser(bytes.NewBuffer(data)) + r.Body = io.NopCloser(bytes.NewBuffer(data)) if err != nil { return errors.BadRequest("CODEC", err.Error())