fix(cli): report output failures and retain saved request options - #41
rupayon123 wants to merge 13 commits into
Conversation
|
Additional fixes pushed to this branch:
Full Go tests, go vet and build pass. Subprocess and local-server regressions cover rejected arguments without requests, failed stdout flushing, 70 KiB WebSocket input, a stalled handshake timeout, mixed-case schemes and invalid saved timeouts. Today's changes have no new findings under golangci-lint v2.13.2 using a migrated copy of the repository configuration. This is a scoped lint result: a full CLI-branch scan still reports 93 findings outside today's changes; the legacy v1 linter cannot read the installed Go 1.27 export format. Prepared with AI assistance. Changes are submitted for review; this is not a claim of maintainer approval. |
|
September 16 verified update: WebSocket receive and stdout failures now exit unsuccessfully; successful headers-only requests close their unread HTTP response body. Each has a regression that failed before the corresponding fix. The final full Go suite, vet, build and scoped lint pass. Closing via defer covers returning paths; fatal process exit still relies on process cleanup. A separate test-cleanup lint correction is included in the branch. Commits: Exact current head: AI-assisted with OpenAI Codex; changes and validation were inspected before submission. |
Problem and change
A small formatted response could return success when the final buffered write failed. Check the final Flush error and return the existing CLI error path. A subprocess regression with a real HTTP test server and closed output destination reproduces the previous successful exit.
Saved requests also dropped JSON filters and HTTP/3 selection. Serialize and restore those fields so a saved request retains its behavior; a temporary-home round-trip regression covers the options together. Old files retain zero-value defaults for the new fields.
Validation
Both regressions failed before their respective fixes. Full env -u NO_COLOR go test ./..., go vet ./..., build, gofmt and git diff --check pass. The color-environment test issue is tracked separately in PR39. No merge or release is implied. Prepared with AI assistance.