github.com/dim13/unifi@v0.0.0-20230308161331-9b04946f5e93/stp_string.go (about)

     1  // Code generated by "stringer -type=STP"; DO NOT EDIT.
     2  
     3  package unifi
     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[StpDisabled-0]
    12  	_ = x[StpBlocking-1]
    13  	_ = x[StpListening-2]
    14  	_ = x[StpLearning-3]
    15  	_ = x[StpForwarding-4]
    16  	_ = x[StpUnknown-9]
    17  }
    18  
    19  const (
    20  	_STP_name_0 = "StpDisabledStpBlockingStpListeningStpLearningStpForwarding"
    21  	_STP_name_1 = "StpUnknown"
    22  )
    23  
    24  var (
    25  	_STP_index_0 = [...]uint8{0, 11, 22, 34, 45, 58}
    26  )
    27  
    28  func (i STP) String() string {
    29  	switch {
    30  	case 0 <= i && i <= 4:
    31  		return _STP_name_0[_STP_index_0[i]:_STP_index_0[i+1]]
    32  	case i == 9:
    33  		return _STP_name_1
    34  	default:
    35  		return "STP(" + strconv.FormatInt(int64(i), 10) + ")"
    36  	}
    37  }