github.com/quay/claircore@v1.5.28/pkg/pep440/op_string.go (about)

     1  // Code generated by "stringer -linecomment -type op"; DO NOT EDIT.
     2  
     3  package pep440
     4  
     5  import "strconv"
     6  
     7  func _() {
     8  	// An "invalid array index" compiler error signifies that the constant values have changed.
     9  	// Re-run the stringer command to generate them again.
    10  	var x [1]struct{}
    11  	_ = x[opMatch-1]
    12  	_ = x[opExclusion-2]
    13  	_ = x[opLTE-3]
    14  	_ = x[opGTE-4]
    15  	_ = x[opLT-5]
    16  	_ = x[opGT-6]
    17  }
    18  
    19  const _op_name = "==!=<=>=<>"
    20  
    21  var _op_index = [...]uint8{0, 2, 4, 6, 8, 9, 10}
    22  
    23  func (i op) String() string {
    24  	i -= 1
    25  	if i < 0 || i >= op(len(_op_index)-1) {
    26  		return "op(" + strconv.FormatInt(int64(i+1), 10) + ")"
    27  	}
    28  	return _op_name[_op_index[i]:_op_index[i+1]]
    29  }