@@ -51,7 +51,7 @@ func NewMiddleware(
5151 if requestsHandler == nil {
5252 return nil , gonethttphandler .ErrNilHandler
5353 }
54-
54+
5555 // Check if the generator is nil
5656 if generator == nil {
5757 return nil , govalidatormapper .ErrNilGenerator
@@ -96,15 +96,16 @@ func NewMiddleware(
9696// NewJSONMiddleware creates a new Middleware instance for JSON requests
9797//
9898// Parameters:
99- //
100- // - requestsHandler: The HTTP handler to parse the request body
101- // - birthdateOptions: The birthdate options (can be nil)
102- // - passwordOptions: The password options (can be nil)
103- // - logger: The logger (can be nil)
104- //
99+ //
100+ // - requestsHandler: The HTTP handler to parse the request body
101+ // - birthdateOptions: The birthdate options (can be nil)
102+ // - passwordOptions: The password options (can be nil)
103+ // - logger: The logger (can be nil)
104+ //
105105// Returns:
106- //
107- // - *Middleware: The middleware instance
106+ //
107+ // - *Middleware: The middleware instance
108+ //
108109// - error: The error if any
109110func NewJSONMiddleware (
110111 requestsHandler gonethttphandler.RequestsHandler ,
@@ -128,14 +129,14 @@ func NewJSONMiddleware(
128129// NewProtoJSONMiddleware creates a new Middleware instance for ProtoJSON requests
129130//
130131// Parameters:
131- //
132+ //
132133// - requestsHandler: The HTTP handler to parse the request body
133134// - birthdateOptions: The birthdate options (can be nil)
134135// - passwordOptions: The password options (can be nil)
135136// - logger: The logger (can be nil)
136- //
137+ //
137138// Returns:
138- //
139+ //
139140// - *Middleware: The middleware instance
140141// - error: The error if any
141142func NewProtoJSONMiddleware (
@@ -146,7 +147,7 @@ func NewProtoJSONMiddleware(
146147) (* Middleware , error ) {
147148 // Create the ProtoJSON mapper generator
148149 generator := govalidatormapper .NewProtobufGenerator (logger )
149-
150+
150151 // Create the middleware
151152 return NewMiddleware (
152153 requestsHandler ,
@@ -169,10 +170,10 @@ func NewProtoJSONMiddleware(
169170// - error: if there was an error creating the mapper
170171func (m Middleware ) createMapper (
171172 structInstance any ,
172- ) (* govalidatormapper.Mapper , reflect.Type , error ) {
173+ ) (* govalidatormapper.Mapper , reflect.Type , error ) {
173174 // Get the type of the request
174175 structInstanceType := goreflect .GetDereferencedType (structInstance )
175-
176+
176177 // Create the mapper
177178 mapper , err := m .generator .NewMapper (structInstance )
178179 if err != nil {
@@ -295,4 +296,4 @@ func (m Middleware) Validate(
295296 panic (err )
296297 }
297298 return validateFn
298- }
299+ }
0 commit comments