// AddTask adds the tasks to the file
AddTask adds the tasks to the file
// AddTask adds the tasks to the file
func AddTask(path string, name string, date string) error {
	tasks, err := ReadTasks(path)
	if err != nil {
		return err
	}
	task := Task{
		Date: date,
		Name: strings.ReplaceAll(name, ",", ";"),
		Done: " ",
	}
	tasks = append(tasks, task)
	err = WriteTasks(path, tasks, true)
	if err != nil {
		return err
	}
	return nil
}
func AddTask ( path string , name string , date string ) error { tasks , err := ReadTasks ( path ) if err != nil { return err } task := Task { Date : date , Name : strings . ReplaceAll ( name , " " , " " ) , Done : " " , } tasks = append ( tasks , task ) err = WriteTasks ( path , tasks , true ) if err != nil { return err } return nil }
AddTask adds the tasks to the file
AddTask adds the tasks to the file
// Read old tasks and add new ones // Write to file