forked from RexBluefox/3b1b-translator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
60 lines (56 loc) · 1.15 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
package main
import (
//"html/template"
"fmt"
"log"
//"net/http"
"github.com/go-git/go-git/v5"
//"github.com/philippta/go-template/html/template"
)
type Todo struct {
Title string
Done bool
}
type Item struct {
Content string
}
type TodoPageData struct {
PageTitle string
Todos []Todo
Items []Item
}
func main() {
repoURL := "https://github.com/maragudk/gomponents.git"
repo, err := git.PlainOpen(repoURL)
if err != nil {
log.Fatal(err)
}
/* repoInfo, err := repo.Remotes()
if err != nil {
log.Fatal(err)
} */
fmt.Println(repo)
/* tmpl := template.Must(template.ParseFiles("layout.html", "dropdown.html"))
dropdown := template.Must(template.ParseFiles("dropdown.html"))
dropdown.
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
data := TodoPageData{
PageTitle: "My TODO list",
Todos: []Todo{
{Title: "Task 1", Done: false},
{Title: "Task 2", Done: true},
{Title: "Task 3", Done: true},
},
Items: []Item{
{Content: "Lets"},
{Content: "fucking"},
{Content: "go"},
},
}
tmpl.Execute(w, data)
})
http.ListenAndServe(":1337", nil) */
}
func test() {
fmt.Println("Test")
}