Get rid of checks when creating constructs. Check should handle this.
This commit is contained in:
@@ -15,13 +15,9 @@ type InlineOtherContent struct {
|
||||
|
||||
// newInlineOtherContent creates a new InlineOtherContent. It returns a
|
||||
// *InlineOtherContent and an error.
|
||||
func newInlineOtherContent(mediaType string, content any) (*InlineOtherContent, error) {
|
||||
if !isValidMediaType(mediaType) {
|
||||
return nil, fmt.Errorf("error creating new inline other content: media type %v invalid", mediaType)
|
||||
}
|
||||
func newInlineOtherContent(mediaType string, content any) *InlineOtherContent {
|
||||
mediaType, _, _ = mime.ParseMediaType(mediaType)
|
||||
|
||||
return &InlineOtherContent{Type: mediaType, AnyElement: content}, nil
|
||||
return &InlineOtherContent{Type: mediaType, AnyElement: content}
|
||||
}
|
||||
|
||||
// isContent checks whether the InlineOtherContent is a Content. It returns a
|
||||
|
Reference in New Issue
Block a user