From e3b9ff0225c79cda35018b79a44606106b4e860a Mon Sep 17 00:00:00 2001 From: Jason Streifling Date: Tue, 15 Oct 2024 19:40:13 +0200 Subject: [PATCH] Move isXMLMediaType to atom.go --- atom.go | 6 ++++++ entry.go | 4 ---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/atom.go b/atom.go index 82715a4..a8f16bd 100644 --- a/atom.go +++ b/atom.go @@ -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") +} diff --git a/entry.go b/entry.go index 458fcf4..0cac599 100644 --- a/entry.go +++ b/entry.go @@ -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}) }