Skip to content

Commit

Permalink
lint fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Raajheer1 committed Mar 11, 2024
1 parent f91ed98 commit 04d4fd7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
2 changes: 1 addition & 1 deletion internal/v1/user-flag/user_flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type Request struct {
NoVisiting bool `json:"no_visiting" example:"false"`
NoVisitingLogEntryID uint `json:"no_visiting_log_entry_id" example:"1"`
NoTransferring bool `json:"no_transferring" example:"false"`
NoTransferringLogEntryID uint `json:"no_transferring_log_entry_id" example:"`
NoTransferringLogEntryID uint `json:"no_transferring_log_entry_id" example:"1"`
NoTraining bool `json:"no_training" example:"false"`
NoTrainingLogEntryID uint `json:"no_training_log_entry_id" example:"1"`
}
Expand Down
25 changes: 0 additions & 25 deletions pkg/go-chi/setup.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@ package go_chi

import (
"github.com/VATUSA/primary-api/pkg/config"
middleware2 "github.com/VATUSA/primary-api/pkg/middleware"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/go-chi/cors"
"github.com/go-chi/render"
"net/http"
)

func New(cfg *config.Config) *chi.Mux {
Expand All @@ -21,28 +19,5 @@ func New(cfg *config.Config) *chi.Mux {

r.Use(cors.Handler(NewCors(cfg)))

Testers(r)

return r
}

func Testers(r *chi.Mux) {
r.Get("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Root."))
})

r.Get("/ping", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("pong."))
})

r.Get("/panic", func(w http.ResponseWriter, r *http.Request) {
panic("test")
})

// Use NotGuest middleware on get route
r.Get("/guest", func(w http.ResponseWriter, r *http.Request) {
middleware2.NotGuest(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Passed"))
})).ServeHTTP(w, r)
})
}

0 comments on commit 04d4fd7

Please sign in to comment.