forked from aksdb/CalAnonSync
Implemented ICal stringer
This commit is contained in:
parent
9a346c5533
commit
fed3e97308
|
@ -86,6 +86,17 @@ func (i *ICal) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (i ICal) String() string {
|
||||
sb := &strings.Builder{}
|
||||
for n, line := range i.data {
|
||||
if n > 0 {
|
||||
sb.WriteRune('\n')
|
||||
}
|
||||
sb.WriteString(line)
|
||||
}
|
||||
return sb.String()
|
||||
}
|
||||
|
||||
func ParseICal(r io.Reader) (*ICal, error) {
|
||||
var data []string
|
||||
scanner := bufio.NewScanner(r)
|
||||
|
|
Loading…
Reference in New Issue