Get rid of checks when creating constructs. Check should handle this.
This commit is contained in:
@@ -13,18 +13,9 @@ type InlineXHTMLContent struct {
|
||||
}
|
||||
|
||||
// newInlineXHTMLContent creates a new InlineXHTMLContent. It returns a
|
||||
// *InlineXHTMLContent and an error.
|
||||
func newInlineXHTMLContent(mediaType string, content any) (*InlineXHTMLContent, error) {
|
||||
if mediaType != "xhtml" {
|
||||
return nil, fmt.Errorf("media type %v incompatible with inline xhtml content", mediaType)
|
||||
}
|
||||
|
||||
xhtmlDiv, ok := content.(*XHTMLDiv)
|
||||
if !ok {
|
||||
return nil, fmt.Errorf("content type %T incompatible with inline xhtml content", content)
|
||||
}
|
||||
|
||||
return &InlineXHTMLContent{Type: mediaType, XHTMLDiv: xhtmlDiv}, nil
|
||||
// *InlineXHTMLContent.
|
||||
func newInlineXHTMLContent(mediaType string, div *XHTMLDiv) *InlineXHTMLContent {
|
||||
return &InlineXHTMLContent{Type: mediaType, XHTMLDiv: div}
|
||||
}
|
||||
|
||||
// isContent checks whether the InlineXHTMLContent is a Content. It returns a
|
||||
|
Reference in New Issue
Block a user