Skip to content

Commit

Permalink
#22: linting
Browse files Browse the repository at this point in the history
  • Loading branch information
roma-glushko committed Jan 1, 2024
1 parent 7b237b3 commit 9ae3f16
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 3 additions & 1 deletion pkg/api/http/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ func LangChatHandler(routerManager *routers.RouterManager) Handler {
c.JSON(consts.StatusNotFound, ErrorSchema{
Message: err.Error(),
})

return
}

Expand All @@ -58,6 +59,7 @@ func LangChatHandler(routerManager *routers.RouterManager) Handler {
c.JSON(consts.StatusInternalServerError, ErrorSchema{
Message: err.Error(),
})

return
}

Expand All @@ -74,6 +76,6 @@ func LangChatHandler(routerManager *routers.RouterManager) Handler {
// @Produce json
// @Success 200 {object} http.HealthSchema
// @Router /v1/health/ [get]
func HealthHandler(ctx context.Context, c *app.RequestContext) {
func HealthHandler(_ context.Context, c *app.RequestContext) {
c.JSON(consts.StatusOK, HealthSchema{Healthy: true})
}
6 changes: 3 additions & 3 deletions pkg/api/http/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

"github.com/hertz-contrib/swagger"
swaggerFiles "github.com/swaggo/files"
_ "glide/docs"
_ "glide/docs" // importing docs package to include them into the binary

"glide/pkg/routers"

Expand Down Expand Up @@ -40,8 +40,8 @@ func (srv *Server) Run() error {
defaultGroup.POST("/language/:router/chat/", LangChatHandler(srv.routerManager))
defaultGroup.GET("/health/", HealthHandler)

schemaDocUrl := swagger.URL(fmt.Sprintf("http://%v/v1/swagger/doc.json", srv.config.HostPort))
defaultGroup.GET("/swagger/*any", swagger.WrapHandler(swaggerFiles.Handler, schemaDocUrl))
schemaDocURL := swagger.URL(fmt.Sprintf("http://%v/v1/swagger/doc.json", srv.config.HostPort))
defaultGroup.GET("/swagger/*any", swagger.WrapHandler(swaggerFiles.Handler, schemaDocURL))

return srv.server.Run()
}
Expand Down

0 comments on commit 9ae3f16

Please sign in to comment.