功能
热更新实现
go get github.com/pilu/fresh
ls $GOPATH/bin
ln -s $GOPATH/bin $GOROOT/bin
$ fresh
10:30:37 runner | InitFolders
10:30:37 runner | mkdir ./tmp
10:30:37 runner | mkdir ./tmp: file exists
10:30:37 watcher | Watching .
10:30:37 watcher | Watching vendor
10:30:37 watcher | Watching vendor/github.com
10:30:37 watcher | Watching vendor/github.com/gin-contrib
10:30:37 watcher | Watching vendor/github.com/gin-contrib/sse
10:30:37 watcher | Watching vendor/github.com/gin-gonic
10:30:37 watcher | Watching vendor/github.com/gin-gonic/gin
10:30:37 watcher | Watching vendor/github.com/gin-gonic/gin/binding
10:30:37 watcher | Watching vendor/github.com/gin-gonic/gin/internal
10:30:37 watcher | Watching vendor/github.com/gin-gonic/gin/internal/json
10:30:37 watcher | Watching vendor/github.com/gin-gonic/gin/render
10:30:37 watcher | Watching vendor/github.com/go-playground
10:30:37 watcher | Watching vendor/github.com/go-playground/locales
10:30:37 watcher | Watching vendor/github.com/go-playground/locales/currency
10:30:37 watcher | Watching vendor/github.com/go-playground/universal-translator
10:30:37 watcher | Watching vendor/github.com/golang
10:30:37 watcher | Watching vendor/github.com/golang/protobuf
10:30:37 watcher | Watching vendor/github.com/golang/protobuf/proto
10:30:37 watcher | Watching vendor/github.com/json-iterator
10:30:37 watcher | Watching vendor/github.com/json-iterator/go
10:30:37 watcher | Watching vendor/github.com/leodido
10:30:37 watcher | Watching vendor/github.com/leodido/go-urn
10:30:37 watcher | Watching vendor/github.com/mattn
10:30:37 watcher | Watching vendor/github.com/mattn/go-isatty
10:30:37 watcher | Watching vendor/github.com/modern-go
10:30:37 watcher | Watching vendor/github.com/modern-go/concurrent
10:30:37 watcher | Watching vendor/github.com/modern-go/reflect2
10:30:37 watcher | Watching vendor/github.com/ugorji
10:30:37 watcher | Watching vendor/github.com/ugorji/go
10:30:37 watcher | Watching vendor/github.com/ugorji/go/codec
10:30:37 watcher | Watching vendor/golang.org
10:30:37 watcher | Watching vendor/golang.org/x
10:30:37 watcher | Watching vendor/golang.org/x/sys
10:30:37 watcher | Watching vendor/golang.org/x/sys/unix
10:30:37 watcher | Watching vendor/gopkg.in
10:30:37 watcher | Watching vendor/gopkg.in/go-playground
10:30:37 watcher | Watching vendor/gopkg.in/go-playground/validator.v9
10:30:37 watcher | Watching vendor/gopkg.in/yaml.v2
10:30:37 main | Waiting (loop 1)...
10:30:37 main | receiving first event /
10:30:37 main | sleeping for 600 milliseconds
10:30:38 main | flushing events
10:30:38 main | Started! (116 Goroutines)
10:30:38 main | remove tmp/runner-build-errors.log: no such file or directory
10:30:38 build | Building...
10:30:38 runner | Running...
10:30:38 main | --------------------
10:30:38 main | Waiting (loop 2)...
10:30:38 app | [GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.
[GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
- using env: export GIN_MODE=release
- using code: gin.SetMode(gin.ReleaseMode)
10:30:38 app | [GIN-debug] GET /md3 --> main.main.func1 (4 handlers)
[GIN-debug] GET /test --> main.main.func2 (3 handlers)
[GIN-debug] Listening and serving HTTP on :8080