chore: splitting monolith into packages

This commit is contained in:
2026-04-02 17:22:55 +02:00
parent 3d61c78c35
commit be1dd05d9b
9 changed files with 171 additions and 116 deletions

20
commands/add_task.go Normal file
View File

@@ -0,0 +1,20 @@
package commands
import (
"fmt"
"gotask-cli/models"
"time"
)
func AddTask(desc string, backlog []models.Task) []models.Task {
newtask := models.Task{
Id: uint(len(backlog)) + 1,
Description: desc,
Status: 0,
Created: time.Now().Unix(),
Updated: -1}
fmt.Printf("New task \"%s\" added to do @ id=%d", newtask.Description, newtask.Id)
backlog = append(backlog, newtask)
return backlog
}