Skip to content

Latest commit

 

History

History
55 lines (46 loc) · 856 Bytes

readme.md

File metadata and controls

55 lines (46 loc) · 856 Bytes

Golang Gin-gonic framework 學習筆記

專案結構

gin-gonic-demo/
|- mian.go
|- handlers
  |- hello.go
  |- login.go
|- router
  |- router.go
|- .gitignore
|- readme.md
|- go.mod

How to use

Swagger API docs

每次調整都需要init一次

swag init

一般運行

go run main.go

Hot reload

https://github.com/cosmtrek/air

Installation

on macOS
curl -fLo ~/.air \
    https://raw.githubusercontent.com/cosmtrek/air/master/bin/darwin/air
chmod +x ~/.air
on Linux
curl -fLo ~/.air \
    https://raw.githubusercontent.com/cosmtrek/air/master/bin/linux/air
chmod +x ~/.air
on Windows
curl -fLo ~/.air.exe \
    https://raw.githubusercontent.com/cosmtrek/air/master/bin/windows/air.exe
Run
 ./air