github.com/gogf/gf/v2@v2.7.4/util/gvalid/internal/builtin/builtin_not_eq.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  // RuleNotEq implements `not-eq` rule:
    10  // Value should be different from value of field.
    11  //
    12  // Format: not-eq:field
    13  type RuleNotEq struct{}
    14  
    15  func init() {
    16  	Register(RuleNotEq{})
    17  }
    18  
    19  func (r RuleNotEq) Name() string {
    20  	return "not-eq"
    21  }
    22  
    23  func (r RuleNotEq) Message() string {
    24  	return "The {field} value `{value}` must not be equal to field {field1} value `{value1}`"
    25  }
    26  
    27  func (r RuleNotEq) Run(in RunInput) error {
    28  	return RuleDifferent{}.Run(in)
    29  }