Get rid of checks when creating constructs. Check should handle this.
This commit is contained in:
11
plainText.go
11
plainText.go
@@ -1,7 +1,6 @@
|
||||
package atom
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
@@ -14,13 +13,9 @@ type PlainText struct {
|
||||
// isText checks whether the PlainText is a Text. It returns a bool.
|
||||
func (p *PlainText) isText() bool { return true }
|
||||
|
||||
// newPlainText creates a new PlainText. It returns a *PlainText and an error.
|
||||
func newPlainText(textType, content string) (*PlainText, error) {
|
||||
if content == "" {
|
||||
return nil, errors.New("error creating new plain text: content string empty")
|
||||
}
|
||||
|
||||
return &PlainText{Type: textType, Text: content}, nil
|
||||
// newPlainText creates a new PlainText. It returns a *PlainText.
|
||||
func newPlainText(textType, content string) *PlainText {
|
||||
return &PlainText{Type: textType, Text: content}
|
||||
}
|
||||
|
||||
// Check checks the PlainText for incompatibilities with RFC4287. It returns an
|
||||
|
Reference in New Issue
Block a user