Add godoc to the exported message.NewURIContent constructor#704
Add godoc to the exported message.NewURIContent constructor#704PratikDhanave wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
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
NewURIContentbehavior: 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.
This comment has been minimized.
This comment has been minimized.
f25235d to
877a099
Compare
This comment has been minimized.
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.
877a099 to
7e6eb14
Compare
Parity Review: ✅ No issuesThis PR only adds a GoDoc comment to the already-exported Scope determination: Documentation-only change — out of scope for cross-repo parity review per the review guidelines. Label status: No upstream .NET or Python surfaces require review for this change. Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
What
Adds a doc comment to the exported
NewURIContentconstructor inmessage/content.go.Why
The
URIContenttype 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 whenmediaTypeis 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/..., andgo test ./message/...all pass.go doc ./message NewURIContentprints the new doc sentence.