Fix DataContent.SaveToFile godoc for the empty-Name and explicit-path cases - #1084
Conversation
… cases The comment said 'otherwise a random name and inferred extension are used', but the random-name behavior actually applies in the empty-path/existing-directory case when Name is empty; when path names a specific (non-existent) file the content is written to that path verbatim. Corrected the description.
There was a problem hiding this comment.
🟢 Approval recommended
The doc-only change accurately describes the implemented behavior.
Pull request overview
Corrects DataContent.SaveToFile documentation to match its actual behavior.
Changes:
- Documents random naming when
Nameis empty. - Clarifies that explicit paths are used verbatim.
File summaries
| File | Summary |
|---|---|
message/datacontent.go |
Corrects SaveToFile godoc. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Scope: internal-only (documentation comment only; no code, API, or behavior change) This PR only corrects a godoc comment to accurately describe the existing (unchanged) branching behavior of
|
DataContent.SaveToFile(message/datacontent.go) doc says: "If path is empty or names an existing directory, Name is used as the file name; otherwise a random name and inferred extension are used."That mis-describes the branches:
Name, or a random name + inferred extension whenNameis empty (os.CreateTemp).pathverbatim (O_EXCL) — no random name.Corrected the comment to match. Doc-only change.