Added and corrected comments
This commit is contained in:
@@ -12,6 +12,8 @@ type InlineOtherContent struct {
|
||||
Type MediaType `xml:"type,attr,omitempty"`
|
||||
}
|
||||
|
||||
// newInlineOtherContent creates a new InlineOtherContent. It returns a
|
||||
// *InlineOtherContent and an error.
|
||||
func newInlineOtherContent(mediaType string, content any) (*InlineOtherContent, error) {
|
||||
if mediaType, _, err := mime.ParseMediaType(mediaType); err != nil {
|
||||
return nil, fmt.Errorf("media type %v incompatible with inline other content", mediaType)
|
||||
@@ -20,12 +22,19 @@ func newInlineOtherContent(mediaType string, content any) (*InlineOtherContent,
|
||||
return &InlineOtherContent{Type: MediaType(mediaType), AnyElement: content}, nil
|
||||
}
|
||||
|
||||
// isContent checks whether the InlineOtherContent is a Content. It returns a
|
||||
// bool.
|
||||
func (i *InlineOtherContent) isContent() bool { return true }
|
||||
|
||||
// hasSRC checks whether the InlineOtherContent has a SRC attribute. It returns
|
||||
// a bool.
|
||||
func (i *InlineOtherContent) hasSRC() bool { return false }
|
||||
|
||||
// getType returns the Type of the InlineOtherContent as a string.
|
||||
func (i *InlineOtherContent) getType() string { return string(i.Type) }
|
||||
|
||||
// Check checks the InlineOtherContent for incompatibilities with RFC4287. It
|
||||
// returns an error.
|
||||
func (i *InlineOtherContent) Check() error {
|
||||
mediaType := i.getType()
|
||||
|
||||
|
Reference in New Issue
Block a user