Update README.md Custom Validator sample code

This commit is contained in:
森 優太 mori 2020-07-30 09:57:03 +09:00 committed by GitHub
parent 4cabdd303f
commit eec8d21189
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -758,12 +758,12 @@ import (
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/binding"
"gopkg.in/go-playground/validator.v10"
"github.com/go-playground/validator/v10"
)
// Booking contains binded and validated data.
type Booking struct {
CheckIn time.Time `form:"check_in" binding:"required" time_format:"2006-01-02"`
CheckIn time.Time `form:"check_in" binding:"required,bookabledate" time_format:"2006-01-02"`
CheckOut time.Time `form:"check_out" binding:"required,gtfield=CheckIn" time_format:"2006-01-02"`
}