github.com/osrg/gobgp/v3@v3.30.0/pkg/zebra/afi_string.go (about)

     1  // Code generated by "stringer -type=afi"; DO NOT EDIT.
     2  
     3  package zebra
     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[afiIP-1]
    12  	_ = x[afiIP6-2]
    13  	_ = x[afiEther-3]
    14  	_ = x[afiMax-4]
    15  }
    16  
    17  const _afi_name = "afiIPafiIP6afiEtherafiMax"
    18  
    19  var _afi_index = [...]uint8{0, 5, 11, 19, 25}
    20  
    21  func (i afi) String() string {
    22  	i -= 1
    23  	if i >= afi(len(_afi_index)-1) {
    24  		return "afi(" + strconv.FormatInt(int64(i+1), 10) + ")"
    25  	}
    26  	return _afi_name[_afi_index[i]:_afi_index[i+1]]
    27  }