Skip to content

encoding/csv: make (w *Writer) Flush() return error #72961

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Guest-615695028 opened this issue Mar 20, 2025 · 4 comments
Closed

encoding/csv: make (w *Writer) Flush() return error #72961

Guest-615695028 opened this issue Mar 20, 2025 · 4 comments
Labels
LibraryProposal Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool Proposal

Comments

@Guest-615695028
Copy link

Proposal Details

Why do you advise us "To check if an error occurred during Flush, call [Writer.Error]" rather than directly changing some codes as below:

func (w *Writer) Flush() error {
	return w.w.Flush()
}
@gabyhelp
Copy link

@gabyhelp gabyhelp added the LibraryProposal Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool label Mar 20, 2025
@Guest-615695028
Copy link
Author

Guest-615695028 commented Mar 20, 2025

I want to know whether the comments under Issue #3931 are reasonable, and which ones are.

  • Adding one return value or more to none, does not affect prior usage.

@gazerro
Copy link
Contributor

gazerro commented Mar 20, 2025

This type assertion would evaluate to false when it previously evaluated to true:

_ , ok = writer.(http.Flusher)

Therefore, this proposal is not backward compatible.

@seankhliao
Copy link
Member

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
LibraryProposal Issues describing a requested change to the Go standard library or x/ libraries, but not to a tool Proposal
Projects
None yet
Development

No branches or pull requests

4 participants