()
| 81 | ) |
| 82 | |
| 83 | func server() *gin.Engine { |
| 84 | if r == nil { |
| 85 | once.Do(func() { |
| 86 | gin.SetMode(gin.ReleaseMode) |
| 87 | r = gin.New() |
| 88 | r.Use(gin.Recovery()) |
| 89 | routes.SetRoutes(r) |
| 90 | }) |
| 91 | } |
| 92 | |
| 93 | return r |
| 94 | } |
| 95 | |
| 96 | func request(method, api string, body io.Reader) *httptest.ResponseRecorder { |
| 97 | req, _ := http.NewRequest(method, api, body) |