Add GetSlice function
This commit is contained in:
parent
30978b9c94
commit
11f1335a20
@ -196,6 +196,14 @@ func (tasklist *TaskList) ArchiveTaskToFile(task Task, filename string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
func (tasklist *TaskList) GetTaskSlice() []*Task {
|
||||
var res []*Task
|
||||
for _, t := range *tasklist {
|
||||
res = append(res, &t)
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
// LoadFromFile loads and returns a TaskList from *os.File.
|
||||
//
|
||||
// Using *os.File instead of a filename allows to also use os.Stdin.
|
||||
|
Loading…
Reference in New Issue
Block a user