mirror of
https://github.com/gin-gonic/gin.git
synced 2025-10-18 23:12:17 +08:00
[FIX] according review issue
This commit is contained in:
parent
f739b8da3b
commit
50f5b16990
@ -50,8 +50,8 @@ type BindingUri interface {
|
|||||||
// of the request. Gin provides a default implementation for this using
|
// of the request. Gin provides a default implementation for this using
|
||||||
// https://github.com/go-playground/validator/tree/v8.18.2.
|
// https://github.com/go-playground/validator/tree/v8.18.2.
|
||||||
type Validater interface {
|
type Validater interface {
|
||||||
// Validate can receive any kind of type and it should never panic, even if the configuration is not right.
|
// If the received type is a slice|array, the validation should be performed travel on every element.
|
||||||
// If the received type is not a struct, any validation should be skipped and nil must be returned.
|
// If the received type is not a struct or slice|array, any validation should be skipped and nil must be returned.
|
||||||
// If the received type is a struct or pointer to a struct, the validation should be performed.
|
// If the received type is a struct or pointer to a struct, the validation should be performed.
|
||||||
// If the struct is not valid or the validation itself fails, a descriptive error should be returned.
|
// If the struct is not valid or the validation itself fails, a descriptive error should be returned.
|
||||||
// Otherwise nil must be returned.
|
// Otherwise nil must be returned.
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
// Copyright 2017 Manu Martinez-Almeida. All rights reserved.
|
// Copyright 2020 Gin Core Team. All rights reserved.
|
||||||
// Use of this source code is governed by a MIT style
|
// Use of this source code is governed by a MIT style
|
||||||
// license that can be found in the LICENSE file.
|
// license that can be found in the LICENSE file.
|
||||||
|
|
||||||
@ -9,7 +9,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Test_sliceValidateError_Error(t *testing.T) {
|
func TestSliceValidateError_Error(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
err sliceValidateError
|
err sliceValidateError
|
||||||
|
Loading…
x
Reference in New Issue
Block a user