diff --git a/app/app.go b/app/app.go index ab07226..4d5ac8f 100644 --- a/app/app.go +++ b/app/app.go @@ -7,10 +7,6 @@ import ( "github.com/gofiber/fiber/v2/middleware/logger" ) -type passReq struct { - Pass string `json:"pass"` -} - func New() *fiber.App { app := fiber.New() conf := config.GetConfig() @@ -31,7 +27,9 @@ func New() *fiber.App { }) app.Post("/check_pass", func(c *fiber.Ctx) error { - req := new(passReq) + req := new(struct { + Pass string `json:"pass"` + }) if err := c.BodyParser(req); err != nil { panic(err) } diff --git a/commands/app.go b/commands/app.go index 226d87c..ed932c5 100644 --- a/commands/app.go +++ b/commands/app.go @@ -6,10 +6,6 @@ import ( "log" ) -type passReq struct { - Pass string `json:"pass"` -} - func run(cmd *cobra.Command, args []string) { app := web.New() log.Fatal(app.Listen(":3000"))