mirror of
https://github.com/nkanaev/yarr.git
synced 2025-11-09 19:08:57 +00:00
Run go fmt
This patch is the result of running `go fmt ./...` with Go v1.16.15.
This commit is contained in:
@@ -32,9 +32,9 @@ func (r *Router) Use(h Handler) {
|
||||
}
|
||||
|
||||
func (r *Router) For(path string, handler Handler) {
|
||||
chain := make([]Handler, 0)
|
||||
chain = append(chain, r.middle...)
|
||||
chain = append(chain, handler)
|
||||
chain := make([]Handler, 0)
|
||||
chain = append(chain, r.middle...)
|
||||
chain = append(chain, handler)
|
||||
|
||||
x := Route{}
|
||||
x.regex = routeRegexp(path)
|
||||
|
||||
@@ -340,7 +340,7 @@ func (s *Server) handleItemList(c *router.Context) {
|
||||
items = items[:perPage]
|
||||
}
|
||||
c.JSON(http.StatusOK, map[string]interface{}{
|
||||
"list": items,
|
||||
"list": items,
|
||||
"has_more": hasMore,
|
||||
})
|
||||
} else if c.Req.Method == "PUT" {
|
||||
|
||||
@@ -10,10 +10,10 @@ import (
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
Addr string
|
||||
db *storage.Storage
|
||||
worker *worker.Worker
|
||||
cache map[string]interface{}
|
||||
Addr string
|
||||
db *storage.Storage
|
||||
worker *worker.Worker
|
||||
cache map[string]interface{}
|
||||
cache_mutex *sync.Mutex
|
||||
|
||||
BasePath string
|
||||
@@ -28,10 +28,10 @@ type Server struct {
|
||||
|
||||
func NewServer(db *storage.Storage, addr string) *Server {
|
||||
return &Server{
|
||||
db: db,
|
||||
Addr: addr,
|
||||
worker: worker.NewWorker(db),
|
||||
cache: make(map[string]interface{}),
|
||||
db: db,
|
||||
Addr: addr,
|
||||
worker: worker.NewWorker(db),
|
||||
cache: make(map[string]interface{}),
|
||||
cache_mutex: &sync.Mutex{},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user