Skip to content

Fix DataContent.SaveToFile godoc for the empty-Name and explicit-path cases - #1084

Merged
Quim Muntal (qmuntal) merged 1 commit into
microsoft:mainfrom
PratikDhanaveFork:datacontent-savetofile-godoc
Sep 16, 2026
Merged

Quim Muntal (qmuntal) merged 1 commit into
microsoft:mainfrom
PratikDhanaveFork:datacontent-savetofile-godoc

Conversation

@PratikDhanave

Copy link
Copy Markdown
Contributor

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:

  • path empty / existing directory: the file is created in that directory using Name, or a random name + inferred extension when Name is empty (os.CreateTemp).
  • otherwise (path names a specific file): the content is written to path verbatim (O_EXCL) — no random name.

Corrected the comment to match. Doc-only change.

… 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.
Copilot AI lite review requested due to automatic review settings September 16, 2026 07:43
@github-actions github-actions Bot added area:message Changes files in the message area size:small At most 30 changed lines across at most 2 files labels Sep 16, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 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 Name is 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.

@github-actions

Copy link
Copy Markdown
Contributor

Scope: internal-only (documentation comment only; no code, API, or behavior change)
Changed Go contract: None — message/datacontent.go SaveToFile godoc comment is corrected to accurately describe existing behavior; no exported identifiers, signatures, defaults, or runtime behavior are modified.
Upstream evidence reviewed: Not applicable — this is a doc-only fix with no behavioral or API surface to compare against .NET/Python.
Result: out of scope

This PR only corrects a godoc comment to accurately describe the existing (unchanged) branching behavior of DataContent.SaveToFile. No exported Go API, defaults, or observable behavior are altered, so there is no cross-repo parity impact with the .NET or Python implementations. No label or inline changes needed.

Generated by Go API Consistency Review Agent · copilot · auto · 13.2 AIC · ⌖ 6.68 AIC · ⊞ 9.6K ·

@github-actions github-actions Bot added the kind:docs Changes documentation or comments label Sep 16, 2026
@qmuntal
Quim Muntal (qmuntal) added this pull request to the merge queue Sep 16, 2026
Merged via the queue into microsoft:main with commit 9d8de0d Sep 16, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:message Changes files in the message area kind:docs Changes documentation or comments size:small At most 30 changed lines across at most 2 files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants