While developing a performance optimization PR that introduces strict json.Unmarshal decoding, the CI runner surfaced a latent bug in the go-github test suite.
In actions_workflow_runs_test.go, the mock HTTP server endpoints for TestActionsService_GetWorkflowRunAttempt and TestActionsService_GetWorkflowRunByID are returning structurally invalid JSON payloads with double closing braces (}}).
The current Client.Do implementation uses json.NewDecoder(resp.Body).Decode(), which is a lazy streaming parser. It reads until the first valid } and silently ignores the trailing garbage byte. Any future PR that moves the client toward stricter, high-throughput parsing (like json.Unmarshal) will instantly fail these tests.
I have isolated this bug and will open an atomic PR to fix it so it doesn't block future optimizations.
While developing a performance optimization PR that introduces strict
json.Unmarshaldecoding, the CI runner surfaced a latent bug in thego-githubtest suite.In
actions_workflow_runs_test.go, the mock HTTP server endpoints forTestActionsService_GetWorkflowRunAttemptandTestActionsService_GetWorkflowRunByIDare returning structurally invalid JSON payloads with double closing braces (}}).The current
Client.Doimplementation usesjson.NewDecoder(resp.Body).Decode(), which is a lazy streaming parser. It reads until the first valid}and silently ignores the trailing garbage byte. Any future PR that moves the client toward stricter, high-throughput parsing (likejson.Unmarshal) will instantly fail these tests.I have isolated this bug and will open an atomic PR to fix it so it doesn't block future optimizations.