瀏覽代碼

chore: save validation

master
Blaz Smehov 1 周之前
父節點
當前提交
e9f89692df
共有 4 個文件被更改,包括 2 次插入2 次删除
  1. 二進制
      bridge
  2. +2
    -2
      internal/pkg/validation/validation.go
  3. 二進制
      location
  4. 二進制
      server

二進制
bridge 查看文件


+ 2
- 2
internal/pkg/validation/validation.go 查看文件

@@ -10,7 +10,7 @@ import (
var defaultValidator = validator.New()

// Struct validates s and returns the first validation error as a readable message, or nil.
func Struct(s interface{}) error {
func Struct(s any) error {
err := defaultValidator.Struct(s)
if err == nil {
return nil
@@ -23,7 +23,7 @@ func Struct(s interface{}) error {
}

// Var validates a single value with the given tag (e.g. "required") and returns an error or nil.
func Var(field interface{}, tag string) error {
func Var(field any, tag string) error {
err := defaultValidator.Var(field, tag)
if err == nil {
return nil


二進制
location 查看文件


二進制
server 查看文件


Loading…
取消
儲存