mirror of
https://github.com/MADTeacher/go_basics.git
synced 2025-11-23 21:34:47 +02:00
add new project step and small fix
This commit is contained in:
19
part_6/6.1/golang/todo/main.go
Normal file
19
part_6/6.1/golang/todo/main.go
Normal file
@@ -0,0 +1,19 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"golang/todo/db"
|
||||
"golang/todo/menu"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
// Создаем репозиторий
|
||||
rep := db.NewSQLiteRepository()
|
||||
// Создаем отложенное закрытие соединения
|
||||
defer rep.Close()
|
||||
// Бесконечный цикл
|
||||
for {
|
||||
menu.CreateMenu(rep)
|
||||
time.Sleep(2 * time.Second)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user