We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4132e77 commit 56435d7Copy full SHA for 56435d7
internal/infra/http/request/student.go
@@ -6,14 +6,15 @@ import (
6
"github.com/go-playground/validator/v10"
7
)
8
9
+// nolint: gochecknoglobals
10
+var validate = validator.New(validator.WithRequiredStructEnabled())
11
+
12
type StudentCreate struct {
13
Name string `json:"name,omitempty" validate:"required,alphaunicode"`
14
Family string `json:"family,omitempty" validate:"required,alphaunicode"`
15
}
16
17
func (sc StudentCreate) Validate() error {
- validate := validator.New(validator.WithRequiredStructEnabled())
-
18
if err := validate.Struct(sc); err != nil {
19
return fmt.Errorf("create request validation failed %w", err)
20
0 commit comments