diff --git a/atom.go b/atom.go index 6049bcb..bb7dd31 100644 --- a/atom.go +++ b/atom.go @@ -16,6 +16,7 @@ type Countable interface { *xml.Attr | *Person | *Category | *Link | *ExtensionElement | *Entry } +// addToSlice adds a Countable to to a *[]Countable func addToSlice[C Countable](slice *[]C, countable C) { if *slice == nil { *slice = make([]C, 0) @@ -23,6 +24,8 @@ func addToSlice[C Countable](slice *[]C, countable C) { *slice = append(*slice, countable) } +// deleteFromSlice deletes the Countable with the index from the *[]Countable. +// It return an error. func deleteFromSlice[C Countable](slice *[]C, id int) error { length := len(*slice) if id > length {