Skip to content

Add godoc to the exported message.NewURIContent constructor#704

Open
PratikDhanave wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:godoc-newuricontent
Open

Add godoc to the exported message.NewURIContent constructor#704
PratikDhanave wants to merge 1 commit into
microsoft:mainfrom
PratikDhanaveFork:godoc-newuricontent

Conversation

@PratikDhanave

Copy link
Copy Markdown
Contributor

What

Adds a doc comment to the exported NewURIContent constructor in message/content.go.

Why

The URIContent type is documented, but its constructor had no doc comment, making it an undocumented exported outlier. The constructor's behavior is non-obvious: it validates the URI, infers the media type from the URI when mediaType is empty, otherwise validates the provided media type, and returns an error on invalid input. Callers need this documented.

This mirrors the documentation conventions of the .NET and Python SDKs, where content constructors document their inference and validation semantics; adding it keeps the Go port aligned.

Testing

Pure docs change. go build ./..., go vet ./message/..., and go test ./message/... all pass. go doc ./message NewURIContent prints the new doc sentence.

@PratikDhanave
PratikDhanave requested a review from a team as a code owner July 24, 2026 02:35
Copilot AI review requested due to automatic review settings July 24, 2026 02:35

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.

Pull request overview

Adds missing GoDoc for the exported message.NewURIContent constructor, bringing it in line with the existing documentation for related exported content types and clarifying its validation/inference behavior for callers.

Changes:

  • Documented NewURIContent behavior: URI validation, media type inference when empty, media type validation when provided, and error conditions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

This comment has been minimized.

@github-actions github-actions Bot added the parity-approved Go API consistency review found no parity issues label Jul 24, 2026
@github-actions

This comment has been minimized.

Document NewURIContent's non-obvious behavior: media-type inference when
empty, validation of a provided media type, and the error conditions.
The URIContent type is already documented, so its constructor was an
undocumented outlier.
@github-actions

Copy link
Copy Markdown
Contributor

Parity Review: ✅ No issues

This PR only adds a GoDoc comment to the already-exported NewURIContent constructor. No exported API surface was added, removed, or changed. No behavior, defaults, or runtime semantics were modified.

Scope determination: Documentation-only change — out of scope for cross-repo parity review per the review guidelines.

Label status: parity-approved is already present and should remain. public-api-change is not applicable — no exported API surface changed.

No upstream .NET or Python surfaces require review for this change.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

Generated by Go API Consistency Review Agent · 14.5 AIC · ⌖ 4.85 AIC · ⊞ 5.9K ·

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

parity-approved Go API consistency review found no parity issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants