Naming, layout and comments: descriptive full-word names, one item per line in wrapped calls and literals, and doc comments on exported names
Short and single-letter names in application code become full words (tests keep theirs). Wrapped calls, signatures and composite literals put one item per line, and one-line function bodies are expanded. Exported names and groups of constants get doc comments, and comments refer to the renamed identifiers.
This commit is contained in:
1 parent
043e307663
commit
465358609a
78 files changed
+2374
-1402
No files matched your search
@@ -67,9 +67,12 @@ func TestIsJSONHandler(t *testing.T) {
|
||||
{"tint", tint.NewTextHandler(io.Discard, nil), false},
|
||||
{"nil", nil, false},
|
||||
{"json with attrs", slog.NewJSONHandler(io.Discard, nil).WithAttrs(
|
||||
[]slog.Attr{slog.String("k", "v")}), true},
|
||||
[]slog.Attr{slog.String("k", "v")},
|
||||
), true},
|
||||
// Only slog's own JSON handler is recognised, not one wrapped in another.
|
||||
{"wrapped json", wrapper{slog.NewJSONHandler(io.Discard, nil)}, false},
|
||||
{"wrapped json", wrapper{
|
||||
Handler: slog.NewJSONHandler(io.Discard, nil),
|
||||
}, false},
|
||||
}
|
||||
for _, tc := range tests {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
|
||||
Reference in new issue
Block a user