fixed struct alignment && refactor linter (#369)
All checks were successful
test / test (push) Successful in 42s

## Pull Request template
Please, go through these steps before clicking submit on this PR.

1. Give a descriptive title to your PR.
2. Provide a description of your changes.
3. Make sure you have some relevant tests.
4. Put `closes #XXXX` in your comment to auto-close the issue that your PR fixes (if applicable).

**PLEASE REMOVE THIS TEMPLATE BEFORE SUBMITTING**

Reviewed-on: #369
Co-authored-by: Evstigneev Denis <danteevstigneev@yandex.ru>
Co-committed-by: Evstigneev Denis <danteevstigneev@yandex.ru>
This commit is contained in:
2024-12-09 16:23:25 +03:00
parent b6a0e4d983
commit 38c5fe8b5a
67 changed files with 480 additions and 398 deletions

View File

@@ -340,7 +340,7 @@ func (s *slogLogger) argsAttrs(args []interface{}) ([]slog.Attr, error) {
case string:
if idx+1 < len(args) {
attrs = append(attrs, slog.Any(arg, args[idx+1]))
idx += 1
idx++
} else {
attrs = append(attrs, slog.String(badKey, arg))
}

View File

@@ -11,9 +11,8 @@ import (
"testing"
"github.com/google/uuid"
"go.unistack.org/micro/v3/metadata"
"go.unistack.org/micro/v3/logger"
"go.unistack.org/micro/v3/metadata"
)
func TestWithHandlerFunc(t *testing.T) {
@@ -133,7 +132,7 @@ func TestErrorf(t *testing.T) {
buf := bytes.NewBuffer(nil)
l := NewLogger(logger.WithLevel(logger.ErrorLevel), logger.WithOutput(buf), logger.WithAddStacktrace(true))
if err := l.Init(logger.WithContextAttrFuncs(func(ctx context.Context) []interface{} {
if err := l.Init(logger.WithContextAttrFuncs(func(_ context.Context) []interface{} {
return nil
})); err != nil {
t.Fatal(err)