github.com/gogf/gf/v2@v2.7.4/util/gvalid/internal/builtin/builtin_bail.go (about)

     1  // Copyright GoFrame Author(https://goframe.org). All Rights Reserved.
     2  //
     3  // This Source Code Form is subject to the terms of the MIT License.
     4  // If a copy of the MIT was not distributed with this file,
     5  // You can obtain one at https://github.com/gogf/gf.
     6  
     7  package builtin
     8  
     9  // RuleBail implements `bail` rule:
    10  // Stop validating when this field's validation failed.
    11  //
    12  // Format: bail
    13  type RuleBail struct{}
    14  
    15  func init() {
    16  	Register(RuleBail{})
    17  }
    18  
    19  func (r RuleBail) Name() string {
    20  	return "bail"
    21  }
    22  
    23  func (r RuleBail) Message() string {
    24  	return ""
    25  }
    26  
    27  func (r RuleBail) Run(in RunInput) error {
    28  	return nil
    29  }