File tree Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Expand file tree Collapse file tree 3 files changed +19
-11
lines changed Original file line number Diff line number Diff line change @@ -12,3 +12,16 @@ modsync:
1212docker : modsync
1313 docker build -t echo-demoapp .
1414 docker run --rm -it -p 8080:8080 echo-demoapp:latest
15+
16+ .PHONY : lint
17+ lint :
18+ golangci-lint run ./...
19+
20+ .PHONY : format
21+ format :
22+ find . -type f -name ' *.go' -not -path ' ./vendor/*' -exec gofmt -s -w {} +
23+ find . -type f -name ' *.go' -not -path ' ./vendor/*' -exec goimports -w {} +
24+
25+ .PHONY : test
26+ test :
27+ go test ./... -race -cover
Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ package entities
22
33type Service interface {
44 List ()
5- }
5+ }
Original file line number Diff line number Diff line change @@ -53,8 +53,7 @@ func (eh *entitiesHTTP) list(c *fiber.Ctx) error {
5353 return c .Status (fiber .StatusBadRequest ).JSON (errMsg )
5454 }
5555
56- c .JSON (entities )
57- return nil
56+ return c .JSON (entities )
5857}
5958
6059func (eh * entitiesHTTP ) get (c * fiber.Ctx ) error {
@@ -70,8 +69,7 @@ func (eh *entitiesHTTP) get(c *fiber.Ctx) error {
7069 return fiber .ErrNotFound
7170 }
7271
73- c .JSON (entity )
74- return nil
72+ return c .JSON (entity )
7573}
7674
7775func (eh * entitiesHTTP ) add (c * fiber.Ctx ) error {
@@ -89,8 +87,7 @@ func (eh *entitiesHTTP) add(c *fiber.Ctx) error {
8987 return c .Status (fiber .StatusInternalServerError ).JSON (errMsg )
9088 }
9189
92- c .JSON (entity )
93- return nil
90+ return c .JSON (entity )
9491}
9592
9693func (eh * entitiesHTTP ) update (c * fiber.Ctx ) error {
@@ -115,8 +112,7 @@ func (eh *entitiesHTTP) update(c *fiber.Ctx) error {
115112 return c .Status (fiber .StatusInternalServerError ).JSON (errMsg )
116113 }
117114
118- c .JSON (entity )
119- return nil
115+ return c .JSON (entity )
120116}
121117
122118func (eh * entitiesHTTP ) delete (c * fiber.Ctx ) error {
@@ -128,6 +124,5 @@ func (eh *entitiesHTTP) delete(c *fiber.Ctx) error {
128124 return c .Status (fiber .StatusInternalServerError ).JSON (errMsg )
129125 }
130126
131- c .JSON (pkg.TextResponse {Message : "entity deleted" })
132- return nil
127+ return c .JSON (pkg.TextResponse {Message : "entity deleted" })
133128}
You can’t perform that action at this time.
0 commit comments