// RemoveTask removes a task by ids
RemoveTask removes a task by ids
// RemoveTask removes a task by ids
func RemoveTask(path string, ids []int) error {
	var old []Task
	var new []Task
	tasks, err := ReadTasks(path)
	if err != nil {
		return err
	}
	removeMap := make(map[int]bool)
	for _, id := range ids {
		id = id - 1 
		removeMap[id] = true
	}
	for i, task := range tasks {
		if _, ok := removeMap[i]; ok {
			old = append(old, task)
		} else {
			new = append(new, task)
		}
	}
	err = WriteTasks(path, new, true)
	if err != nil {
		return err
	}
	fmt.Printf("\nRemoved: \n")
	for _, task := range old {
		fmt.Printf("   %s\n", task.Name)
	}
	return nil
}
func RemoveTask ( path string , ids [ ] int ) error { var old [ ] Task var new [ ] Task tasks , err := ReadTasks ( path ) if err != nil { return err } removeMap := make ( map [ int ] bool ) for _ , id := range ids { id = id - 1 removeMap [ id ] = true } for i , task := range tasks { if _ , ok := removeMap [ i ] ; ok { old = append ( old , task ) } else { new = append ( new , task ) } } err = WriteTasks ( path , new , true ) if err != nil { return err } fmt . Printf ( " \n \n " ) for _ , task := range old { fmt . Printf ( " \n " , task . Name ) } return nil }
RemoveTask removes a task by ids
RemoveTask removes a task by ids
// Read from file // Create remove map // index 0 // Update status // Write to file