$ the-wire · showcase
GO RUNTIME FIXES A SUBTLE BODY-CLOSE BUG
By RepoJournal · Filed · About Go · Composed from the cited sources · methodology
The net/http change you didn't know you needed just landed, and it could save you from chasing a phantom io.EOF.
The first story of the day is a quiet but critical fix in net/http: closing a server request body now correctly returns nil instead of io.EOF when the handler stops reading early and the body is drained [1]. This regression came from CL 794640, which consolidated request body draining and dropped the assignment that cleared the error. For any handler that relies on Close returning nil after a successful drain, this is the fix you've been waiting for. Meanwhile, the compiler team is at it again on loong64: a new optimization folds ANDconst with 16/32-bit all-ones masks into zero-extension instructions, removing 644 instructions from the Go binary [2]. That's a meaningful win for anyone targeting loong64. The third story is a Plan 9 landmine: using LEAVE on amd64 for Plan 9 stubs can cause a crash because BP holds the system call number, not the frame pointer [3]. This is a 'pat your back if you're on Plan 9' moment, but it's a good reminder that platform-specific code has sharp edges. If you're on Plan 9, this change is a must-have before your next build. For the rest of us, the net/http fix deserves a quick patch and a regression test.
Action items
- → Review net/http request body close handling and update if you rely on Close returning nil after drain golang/go [immediate]
- → If targeting loong64, rebuild your binary to pick up the instruction fold optimization golang/go [plan]
- → For Plan 9/amd64 builds, verify your toolchain includes the LEAVE avoidance fix before deploying golang/go [immediate]
References