Move isXMLMediaType to atom.go

This commit is contained in:
Jason Streifling 2024-10-15 19:40:13 +02:00
parent b08b62e794
commit e3b9ff0225
2 changed files with 6 additions and 4 deletions

View File

@ -1,8 +1,14 @@
package atomfeed
import "strings"
type (
EmailAddress string
LanguageTag string
MediaType string
URI string
)
func isXMLMediaType(mediaType string) bool {
return strings.HasSuffix(mediaType, "/xml") || strings.HasSuffix(mediaType, "+xml")
}

View File

@ -59,10 +59,6 @@ func alternateRelExists(l []*Link) bool {
return false
}
func isXMLMediaType(mediaType string) bool {
return strings.HasSuffix(mediaType, "/xml") || strings.HasSuffix(mediaType, "+xml")
}
func (e *Entry) AddExtension(name string, value any) {
e.Extensions = append(e.Extensions, &ExtensionElement{XMLName: xml.Name{Local: name}, Value: value})
}