-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
58 lines (50 loc) · 1.08 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
package main
import (
"log"
"net/http"
"os"
"github.com/gin-gonic/gin"
)
func main() {
port := os.Getenv("PORT")
if port == "" {
log.Fatal("$PORT must be set")
}
router := gin.New()
router.Use(gin.Logger())
router.LoadHTMLGlob("templates/*.tmpl.html")
router.Static("/static", "static")
router.GET("/", func(c *gin.Context) {
c.HTML(http.StatusOK, "index.tmpl.html", nil)
})
router.Run(":" + port)
// slice := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
// theMap := map[int]string{
// 1: "Dom",
// 2: "Tina",
// 3: "Mia",
// 4: "Christian",
// 5: "Luka",
// }
//
// fmt.Println(theMap)
//
// fmt.Println("slice:", slice)
//
// sliceOfSlice25 := slice[2:5]
// sliceOfSlice47 := slice[4:7]
//
// fmt.Println("sliceOfSlice25:", sliceOfSlice25)
// fmt.Println("sliceOfSlice47:", sliceOfSlice47)
//
// sliceCopy := make([]int, 3)
// copy(sliceCopy, slice[3:6])
//
// slice[4] = 11
//
// fmt.Println("slice:", slice)
// fmt.Println("sliceOfSlice25:", sliceOfSlice25)
// fmt.Println("sliceOfSlice47:", sliceOfSlice47)
// fmt.Println("sliceCopy:", sliceCopy)
//
}