caldav: upgrade to latest go-ical API

This commit is contained in:
Simon Ser 2020-02-24 21:16:45 +01:00
parent 4c419a961d
commit 514296664c
No known key found for this signature in database
GPG Key ID: 0FDE7BE0E88F5E48
3 changed files with 6 additions and 6 deletions

View File

@ -180,7 +180,7 @@ func decodeCalendarObjectList(ms *internal.Multistatus) ([]CalendarObject, error
} }
r := bytes.NewReader(calData.Data) r := bytes.NewReader(calData.Data)
data, err := ical.NewDecoder(r).DecodeCalendar() data, err := ical.NewDecoder(r).Decode()
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -264,7 +264,7 @@ func (c *Client) GetCalendarObject(path string) (*CalendarObject, error) {
return nil, fmt.Errorf("caldav: expected Content-Type %q, got %q", ical.MIMEType, mediaType) return nil, fmt.Errorf("caldav: expected Content-Type %q, got %q", ical.MIMEType, mediaType)
} }
cal, err := ical.NewDecoder(resp.Body).DecodeCalendar() cal, err := ical.NewDecoder(resp.Body).Decode()
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -287,7 +287,7 @@ func (c *Client) PutCalendarObject(path string, cal *ical.Calendar) (*CalendarOb
// https://github.com/Kozea/Radicale/issues/1016 // https://github.com/Kozea/Radicale/issues/1016
var buf bytes.Buffer var buf bytes.Buffer
if err := ical.NewEncoder(&buf).EncodeCalendar(cal); err != nil { if err := ical.NewEncoder(&buf).Encode(cal); err != nil {
return nil, err return nil, err
} }

2
go.mod
View File

@ -3,6 +3,6 @@ module github.com/emersion/go-webdav
go 1.13 go 1.13
require ( require (
github.com/emersion/go-ical v0.0.0-20200224170602-c9b8621220bc github.com/emersion/go-ical v0.0.0-20200224201310-cd514449c39e
github.com/emersion/go-vcard v0.0.0-20191221110513-5f81fa0d3cc7 github.com/emersion/go-vcard v0.0.0-20191221110513-5f81fa0d3cc7
) )

4
go.sum
View File

@ -1,4 +1,4 @@
github.com/emersion/go-ical v0.0.0-20200224170602-c9b8621220bc h1:kpISLFxf4eYcslxD/XkzE2Su7UQdNKt0XYgnN6MEUxg= github.com/emersion/go-ical v0.0.0-20200224201310-cd514449c39e h1:YGM1sI7edZOt8KAfX9Miq/X99d2QXdgjkJ7vN4HjxAA=
github.com/emersion/go-ical v0.0.0-20200224170602-c9b8621220bc/go.mod h1:4xVTBPcT43a1pp3vdaa+FuRdX5XhKCZPpWv7m0z9ByM= github.com/emersion/go-ical v0.0.0-20200224201310-cd514449c39e/go.mod h1:4xVTBPcT43a1pp3vdaa+FuRdX5XhKCZPpWv7m0z9ByM=
github.com/emersion/go-vcard v0.0.0-20191221110513-5f81fa0d3cc7 h1:SE+tcd+0kn0cT4MqTo66gmkjqWHF1Z+Yha5/rhLs/H8= github.com/emersion/go-vcard v0.0.0-20191221110513-5f81fa0d3cc7 h1:SE+tcd+0kn0cT4MqTo66gmkjqWHF1Z+Yha5/rhLs/H8=
github.com/emersion/go-vcard v0.0.0-20191221110513-5f81fa0d3cc7/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM= github.com/emersion/go-vcard v0.0.0-20191221110513-5f81fa0d3cc7/go.mod h1:HMJKR5wlh/ziNp+sHEDV2ltblO4JD2+IdDOWtGcQBTM=