From cf572bc5fc4647ea675c8a3482d80d181f62c66c Mon Sep 17 00:00:00 2001 From: Hitoshi Irino Date: Sat, 25 Apr 2020 22:06:21 +0900 Subject: Refactoring Zebra and supporting frr7.3 - Change const values to camel case from snake case to make zero golint's warnigns - Introduce convert functions (toEach, toCommon) between the newest version to older versions - Merge code about decode nexthop to reduce lines of code - Add frr7.3 statemet in allowable software for config - Rename and Update generated file by stringer --- internal/pkg/zebra/afi_string.go | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) (limited to 'internal/pkg/zebra/afi_string.go') diff --git a/internal/pkg/zebra/afi_string.go b/internal/pkg/zebra/afi_string.go index 6a4278a3..1cda4d15 100644 --- a/internal/pkg/zebra/afi_string.go +++ b/internal/pkg/zebra/afi_string.go @@ -1,17 +1,27 @@ -// Code generated by "stringer -type=AFI"; DO NOT EDIT. +// Code generated by "stringer -type=afi"; DO NOT EDIT. package zebra import "strconv" -const _AFI_name = "AFI_IPAFI_IP6AFI_ETHERAFI_MAX" +func _() { + // An "invalid array index" compiler error signifies that the constant values have changed. + // Re-run the stringer command to generate them again. + var x [1]struct{} + _ = x[afiIP-1] + _ = x[afiIP6-2] + _ = x[afiEther-3] + _ = x[afiMax-4] +} + +const _afi_name = "afiIPafiIP6afiEtherafiMax" -var _AFI_index = [...]uint8{0, 6, 13, 22, 29} +var _afi_index = [...]uint8{0, 5, 11, 19, 25} -func (i AFI) String() string { +func (i afi) String() string { i -= 1 - if i >= AFI(len(_AFI_index)-1) { - return "AFI(" + strconv.FormatInt(int64(i+1), 10) + ")" + if i >= afi(len(_afi_index)-1) { + return "afi(" + strconv.FormatInt(int64(i+1), 10) + ")" } - return _AFI_name[_AFI_index[i]:_AFI_index[i+1]] + return _afi_name[_afi_index[i]:_afi_index[i+1]] } -- cgit v1.2.3