Skip to content

Commit e3560a2

Browse files
committed
docs(lint): fix backwards field-order description in File's layout test
Round-2 code review flagged that TestFile_SizeBudget's comment described the trailing scalar order as "the two 8-byte scalars next, the two byte-sized bools last", the opposite of what file.go actually declares (StripFrontMatter, DryRun, then LineOffset, MaxInputBytes). Fix the comment to match the real layout.
1 parent 794c48e commit e3560a2

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

internal/lint/file_size_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,11 @@ import (
1414
// across every file in the workspace. The four scalar fields
1515
// (LineOffset, MaxInputBytes, StripFrontMatter, DryRun) previously
1616
// sat at the top of the struct, interleaved with 8-byte-aligned
17-
// pointer/slice/string fields; large-to-small ordering — pointer and
18-
// slice fields first, the two 8-byte scalars next, the two
19-
// byte-sized bools last — packs the struct into 640 bytes instead of
20-
// 688 (docs/development/high-performance-go.md#struct-layout).
17+
// pointer/slice/string fields; grouping every pointer-bearing field
18+
// first, then the two byte-sized bools (packed alongside the other
19+
// 4-byte-aligned lazy-init guards), then the two 8-byte scalars last
20+
// — packs the struct into 640 bytes instead of 688
21+
// (docs/development/high-performance-go.md#struct-layout).
2122
const fileSizeBudget = 640
2223

2324
func TestFile_SizeBudget(t *testing.T) {

0 commit comments

Comments
 (0)