package main import "fmt" func reduce[T, M any](s []T, f func(M, T) M, initValue M) M { acc := initValue for _, v := range s { acc = f(acc, v) } return acc } func main() { numbers := []int{1, 2, 3, 4, 5} sum := reduce(numbers, func(acc, current int) int { return acc + current }, 0) fmt.Println(sum) } https://gosamples.dev/tags/generics-intro/ 참고
Fiber Basics 파이버는 웹 개발을 위한 API 구축을 돕는 go 패키지. 이 것은 Node.js의 Express Framework에서 영감을 받아 https://github.com/valyala/fasthttp 위에 구축 node.js로 API를 구축한 경험이 있다면, Fiber in Go로 시작하는 것이 더 쉬울 것으로 보임 What are we building? Create a API server to run local Connect to database (sqlite3) Send Get request Send Post request type Camping struct { Id uint `json:"id"` Title string `json:"title"` Address string `jso..

go fiber docs: https://docs.gofiber.io/ dev blog: https://dev.to/koddr/go-fiber-by-examples-how-can-the-fiber-web-framework-be-useful-487a 📖 Go Fiber by Examples: How can the Fiber Web Framework be useful? Introduction Hello and welcome, DEV friends! 👋 As you probably know, the printed book... dev.to fiber는 nodejs의 Express에 영감을 받아 가장 상위에 golang의 fasthttp(go에서 가장 빠른 http engine)을 탑재한 웹 프레임워크임. fi..