aboutsummaryrefslogtreecommitdiffhomepage
path: root/media
diff options
context:
space:
mode:
Diffstat (limited to 'media')
-rw-r--r--media/mediaType.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/media/mediaType.go b/media/mediaType.go
index 8a2efc4a4..21d4ddca5 100644
--- a/media/mediaType.go
+++ b/media/mediaType.go
@@ -378,6 +378,11 @@ func DecodeTypes(mms ...map[string]interface{}) (Types, error) {
return m, nil
}
+// IsZero reports whether this Type represents a zero value.
+func (m Type) IsZero() bool {
+ return m.SubType == ""
+}
+
// MarshalJSON returns the JSON encoding of m.
func (m Type) MarshalJSON() ([]byte, error) {
type Alias Type