From 987542f89b58f05e90fd2fb048f0271edf004fea Mon Sep 17 00:00:00 2001 From: Ben Sarmiento Date: Thu, 19 Oct 2023 23:50:08 +0200 Subject: [PATCH] omitempty for xml properties --- pkg/dav/types.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/dav/types.go b/pkg/dav/types.go index ed3bcf4..007934a 100644 --- a/pkg/dav/types.go +++ b/pkg/dav/types.go @@ -19,11 +19,11 @@ type PropStat struct { } type Prop struct { - ResourceType ResourceType `xml:"d:resourcetype"` - ContentLength int64 `xml:"d:getcontentlength"` - CreationDate string `xml:"d:creationdate"` - LastModified string `xml:"d:getlastmodified"` - ContentType string `xml:"d:getcontenttype"` + ResourceType ResourceType `xml:"d:resourcetype,omitempty"` + ContentLength int64 `xml:"d:getcontentlength,omitempty"` + CreationDate string `xml:"d:creationdate,omitempty"` + LastModified string `xml:"d:getlastmodified,omitempty"` + ContentType string `xml:"d:getcontenttype,omitempty"` } type ResourceType struct {