From 1814ae52f4b7b81a084e3739368d430343fa8f16 Mon Sep 17 00:00:00 2001 From: Feng Ruohang Date: Tue, 4 Aug 2026 22:44:59 +0800 Subject: [PATCH] build: regenerate and verify all generated outputs Expand the generated-file gate beyond *_gen.go and go.sum to cover generated tests, msgp output, stringer files, go.mod, and untracked generated artifacts. Regenerate the 19 stale stringer outputs with the go.mod-pinned x/tools version. Runtime String output is unchanged, and a repeated generation pass now leaves the tree byte-identical. Co-authored-by: ChatGPT Co-authored-by: Claude --- Makefile | 14 ++++++++++++-- cmd/apierrorcode_string.go | 5 +++-- cmd/authtype_string.go | 5 +++-- cmd/batchjobmetric_string.go | 5 +++-- cmd/decommetric_string.go | 5 +++-- cmd/format_string.go | 5 +++-- cmd/healingmetric_string.go | 5 +++-- cmd/lceventsrc_string.go | 5 +++-- cmd/osmetric_string.go | 5 +++-- cmd/rebalancemetric_string.go | 5 +++-- cmd/rebalstatus_string.go | 5 +++-- cmd/scannermetric_string.go | 5 +++-- cmd/storagemetric_string.go | 5 +++-- cmd/stserrorcode_string.go | 5 +++-- cmd/xl-storage-format-v2_string.go | 10 ++++++---- internal/bucket/lifecycle/action_string.go | 5 +++-- internal/grid/debugmsg_string.go | 5 +++-- internal/grid/handlers_string.go | 5 +++-- internal/grid/msg_string.go | 8 ++++---- .../logger/target/loggertypes/targettype_string.go | 8 ++++---- 20 files changed, 74 insertions(+), 46 deletions(-) diff --git a/Makefile b/Makefile index fd306ef15..2573608e8 100644 --- a/Makefile +++ b/Makefile @@ -37,8 +37,18 @@ verifiers: lint check-gen check-gen: ## check for updated autogenerated files @go generate ./... >/dev/null @go mod tidy -compat=1.26 - @(! git diff --name-only | grep '_gen.go$$') || (echo "Non-committed changes in auto-generated code is detected, please commit them to proceed." && false) - @(! git diff --name-only | grep 'go.sum') || (echo "Non-committed changes in auto-generated go.sum is detected, please commit them to proceed." && false) + @changed=$$(git diff --name-only -- '*_gen.go' '*_gen_test.go' '*_msgp_test.go' '*_string.go' go.mod go.sum); \ + if [ -n "$$changed" ]; then \ + echo "Non-committed generated changes detected:"; \ + echo "$$changed"; \ + exit 1; \ + fi + @untracked=$$(git ls-files --others --exclude-standard -- '*_gen.go' '*_gen_test.go' '*_msgp_test.go' '*_string.go'); \ + if [ -n "$$untracked" ]; then \ + echo "Untracked generated files detected:"; \ + echo "$$untracked"; \ + exit 1; \ + fi lint: getdeps ## runs golangci-lint suite of linters @echo "Running $@ check" diff --git a/cmd/apierrorcode_string.go b/cmd/apierrorcode_string.go index d9973d887..78723c34c 100644 --- a/cmd/apierrorcode_string.go +++ b/cmd/apierrorcode_string.go @@ -347,8 +347,9 @@ const _APIErrorCode_name = "NoneAccessDeniedBadDigestEntityTooSmallEntityTooLarg var _APIErrorCode_index = [...]uint16{0, 4, 16, 25, 39, 53, 67, 81, 94, 112, 129, 144, 161, 174, 186, 208, 228, 254, 268, 289, 306, 321, 344, 361, 379, 396, 420, 435, 456, 474, 486, 506, 523, 546, 567, 579, 597, 618, 646, 676, 697, 720, 746, 783, 813, 846, 871, 903, 933, 962, 987, 1009, 1035, 1057, 1085, 1114, 1148, 1179, 1216, 1240, 1264, 1292, 1318, 1349, 1379, 1388, 1400, 1416, 1429, 1443, 1461, 1481, 1502, 1518, 1529, 1545, 1556, 1584, 1604, 1620, 1648, 1662, 1679, 1699, 1712, 1726, 1739, 1752, 1768, 1785, 1806, 1820, 1841, 1854, 1876, 1899, 1915, 1930, 1945, 1966, 1984, 1999, 2016, 2041, 2059, 2082, 2097, 2116, 2132, 2151, 2172, 2186, 2198, 2211, 2230, 2249, 2259, 2274, 2310, 2341, 2374, 2403, 2415, 2435, 2459, 2483, 2504, 2528, 2547, 2568, 2585, 2595, 2612, 2629, 2650, 2670, 2693, 2715, 2741, 2762, 2780, 2807, 2838, 2865, 2886, 2907, 2931, 2956, 2984, 3012, 3028, 3051, 3081, 3092, 3104, 3121, 3136, 3154, 3183, 3200, 3216, 3232, 3250, 3268, 3291, 3312, 3335, 3346, 3362, 3385, 3402, 3430, 3449, 3479, 3499, 3527, 3542, 3560, 3575, 3589, 3624, 3643, 3654, 3667, 3682, 3705, 3731, 3747, 3765, 3783, 3804, 3818, 3835, 3866, 3886, 3907, 3928, 3947, 3966, 3984, 4007, 4031, 4055, 4080, 4115, 4140, 4174, 4207, 4228, 4242, 4261, 4290, 4313, 4340, 4374, 4406, 4436, 4459, 4487, 4519, 4547, 4571, 4595, 4624, 4642, 4659, 4681, 4698, 4716, 4736, 4762, 4778, 4797, 4818, 4822, 4840, 4857, 4883, 4897, 4921, 4942, 4957, 4975, 4998, 5013, 5032, 5049, 5066, 5090, 5117, 5140, 5163, 5180, 5202, 5218, 5238, 5257, 5279, 5300, 5320, 5342, 5366, 5385, 5427, 5448, 5471, 5492, 5523, 5542, 5564, 5584, 5610, 5631, 5653, 5673, 5697, 5720, 5739, 5759, 5781, 5804, 5835, 5873, 5914, 5944, 5958, 5979, 5995, 6017, 6047, 6073, 6101, 6135, 6153, 6176, 6211, 6251, 6293, 6325, 6342, 6367, 6382, 6399, 6409, 6420, 6458, 6512, 6558, 6610, 6658, 6701, 6745, 6773, 6787, 6805, 6841, 6864, 6887, 6909, 6924, 6952, 6975, 6993, 7020, 7052, 7067, 7083, 7100, 7120, 7136, 7152, 7169, 7182} func (i APIErrorCode) String() string { - if i < 0 || i >= APIErrorCode(len(_APIErrorCode_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_APIErrorCode_index)-1 { return "APIErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" } - return _APIErrorCode_name[_APIErrorCode_index[i]:_APIErrorCode_index[i+1]] + return _APIErrorCode_name[_APIErrorCode_index[idx]:_APIErrorCode_index[idx+1]] } diff --git a/cmd/authtype_string.go b/cmd/authtype_string.go index 0fea54815..1eb428175 100644 --- a/cmd/authtype_string.go +++ b/cmd/authtype_string.go @@ -27,8 +27,9 @@ const _authType_name = "UnknownAnonymousPresignedPresignedV2PostPolicyStreamingS var _authType_index = [...]uint8{0, 7, 16, 25, 36, 46, 61, 67, 75, 78, 81, 103, 127} func (i authType) String() string { - if i < 0 || i >= authType(len(_authType_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_authType_index)-1 { return "authType(" + strconv.FormatInt(int64(i), 10) + ")" } - return _authType_name[_authType_index[i]:_authType_index[i+1]] + return _authType_name[_authType_index[idx]:_authType_index[idx+1]] } diff --git a/cmd/batchjobmetric_string.go b/cmd/batchjobmetric_string.go index a1697a19d..81658edfd 100644 --- a/cmd/batchjobmetric_string.go +++ b/cmd/batchjobmetric_string.go @@ -18,8 +18,9 @@ const _batchJobMetric_name = "ReplicationKeyRotationExpire" var _batchJobMetric_index = [...]uint8{0, 11, 22, 28} func (i batchJobMetric) String() string { - if i >= batchJobMetric(len(_batchJobMetric_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_batchJobMetric_index)-1 { return "batchJobMetric(" + strconv.FormatInt(int64(i), 10) + ")" } - return _batchJobMetric_name[_batchJobMetric_index[i]:_batchJobMetric_index[i+1]] + return _batchJobMetric_name[_batchJobMetric_index[idx]:_batchJobMetric_index[idx+1]] } diff --git a/cmd/decommetric_string.go b/cmd/decommetric_string.go index fb485ab01..c56e636de 100644 --- a/cmd/decommetric_string.go +++ b/cmd/decommetric_string.go @@ -18,8 +18,9 @@ const _decomMetric_name = "DecommissionBucketDecommissionObjectDecommissionRemov var _decomMetric_index = [...]uint8{0, 18, 36, 60} func (i decomMetric) String() string { - if i >= decomMetric(len(_decomMetric_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_decomMetric_index)-1 { return "decomMetric(" + strconv.FormatInt(int64(i), 10) + ")" } - return _decomMetric_name[_decomMetric_index[i]:_decomMetric_index[i+1]] + return _decomMetric_name[_decomMetric_index[idx]:_decomMetric_index[idx+1]] } diff --git a/cmd/format_string.go b/cmd/format_string.go index ce068152a..7c89499a4 100644 --- a/cmd/format_string.go +++ b/cmd/format_string.go @@ -21,8 +21,9 @@ const _format_name = "UnknownGzipZstdLZ4S2BZ2" var _format_index = [...]uint8{0, 7, 11, 15, 18, 20, 23} func (i format) String() string { - if i < 0 || i >= format(len(_format_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_format_index)-1 { return "format(" + strconv.FormatInt(int64(i), 10) + ")" } - return _format_name[_format_index[i]:_format_index[i+1]] + return _format_name[_format_index[idx]:_format_index[idx+1]] } diff --git a/cmd/healingmetric_string.go b/cmd/healingmetric_string.go index 012fc7aa9..f1b5f6189 100644 --- a/cmd/healingmetric_string.go +++ b/cmd/healingmetric_string.go @@ -18,8 +18,9 @@ const _healingMetric_name = "BucketObjectCheckAbandonedParts" var _healingMetric_index = [...]uint8{0, 6, 12, 31} func (i healingMetric) String() string { - if i >= healingMetric(len(_healingMetric_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_healingMetric_index)-1 { return "healingMetric(" + strconv.FormatInt(int64(i), 10) + ")" } - return _healingMetric_name[_healingMetric_index[i]:_healingMetric_index[i+1]] + return _healingMetric_name[_healingMetric_index[idx]:_healingMetric_index[idx+1]] } diff --git a/cmd/lceventsrc_string.go b/cmd/lceventsrc_string.go index dd121abb4..3d859dc40 100644 --- a/cmd/lceventsrc_string.go +++ b/cmd/lceventsrc_string.go @@ -26,8 +26,9 @@ const _lcEventSrc_name = "NoneHealScannerDecomRebals3HeadObjects3GetObjects3List var _lcEventSrc_index = [...]uint8{0, 4, 8, 15, 20, 25, 37, 48, 61, 72, 84, 109} func (i lcEventSrc) String() string { - if i >= lcEventSrc(len(_lcEventSrc_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_lcEventSrc_index)-1 { return "lcEventSrc(" + strconv.FormatInt(int64(i), 10) + ")" } - return _lcEventSrc_name[_lcEventSrc_index[i]:_lcEventSrc_index[i+1]] + return _lcEventSrc_name[_lcEventSrc_index[idx]:_lcEventSrc_index[idx+1]] } diff --git a/cmd/osmetric_string.go b/cmd/osmetric_string.go index 2f5f49fca..fe19c30e5 100644 --- a/cmd/osmetric_string.go +++ b/cmd/osmetric_string.go @@ -34,8 +34,9 @@ const _osMetric_name = "RemoveAllMkdirAllMkdirRenameOpenFileWOpenFileROpenFileWF var _osMetric_index = [...]uint8{0, 9, 17, 22, 28, 37, 46, 57, 68, 72, 88, 93, 99, 103, 109, 115, 125, 134, 138, 142} func (i osMetric) String() string { - if i >= osMetric(len(_osMetric_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_osMetric_index)-1 { return "osMetric(" + strconv.FormatInt(int64(i), 10) + ")" } - return _osMetric_name[_osMetric_index[i]:_osMetric_index[i+1]] + return _osMetric_name[_osMetric_index[idx]:_osMetric_index[idx+1]] } diff --git a/cmd/rebalancemetric_string.go b/cmd/rebalancemetric_string.go index 930e04341..c62b4da89 100644 --- a/cmd/rebalancemetric_string.go +++ b/cmd/rebalancemetric_string.go @@ -20,8 +20,9 @@ const _rebalanceMetric_name = "RebalanceBucketsRebalanceBucketRebalanceObjectReb var _rebalanceMetric_index = [...]uint8{0, 16, 31, 46, 67, 79} func (i rebalanceMetric) String() string { - if i >= rebalanceMetric(len(_rebalanceMetric_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_rebalanceMetric_index)-1 { return "rebalanceMetric(" + strconv.FormatInt(int64(i), 10) + ")" } - return _rebalanceMetric_name[_rebalanceMetric_index[i]:_rebalanceMetric_index[i+1]] + return _rebalanceMetric_name[_rebalanceMetric_index[idx]:_rebalanceMetric_index[idx+1]] } diff --git a/cmd/rebalstatus_string.go b/cmd/rebalstatus_string.go index 0dc74b217..5436cfe49 100644 --- a/cmd/rebalstatus_string.go +++ b/cmd/rebalstatus_string.go @@ -20,8 +20,9 @@ const _rebalStatus_name = "NoneStartedCompletedStoppedFailed" var _rebalStatus_index = [...]uint8{0, 4, 11, 20, 27, 33} func (i rebalStatus) String() string { - if i >= rebalStatus(len(_rebalStatus_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_rebalStatus_index)-1 { return "rebalStatus(" + strconv.FormatInt(int64(i), 10) + ")" } - return _rebalStatus_name[_rebalStatus_index[i]:_rebalStatus_index[i+1]] + return _rebalStatus_name[_rebalStatus_index[idx]:_rebalStatus_index[idx+1]] } diff --git a/cmd/scannermetric_string.go b/cmd/scannermetric_string.go index 32c7a4f89..7c8e1cff7 100644 --- a/cmd/scannermetric_string.go +++ b/cmd/scannermetric_string.go @@ -37,8 +37,9 @@ const _scannerMetric_name = "ReadMetadataCheckMissingSaveUsageApplyAllApplyVersi var _scannerMetric_index = [...]uint8{0, 12, 24, 33, 41, 53, 65, 74, 77, 93, 98, 112, 127, 147, 157, 167, 186, 198, 208, 217, 232, 245, 249} func (i scannerMetric) String() string { - if i >= scannerMetric(len(_scannerMetric_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_scannerMetric_index)-1 { return "scannerMetric(" + strconv.FormatInt(int64(i), 10) + ")" } - return _scannerMetric_name[_scannerMetric_index[i]:_scannerMetric_index[i+1]] + return _scannerMetric_name[_scannerMetric_index[idx]:_scannerMetric_index[idx+1]] } diff --git a/cmd/storagemetric_string.go b/cmd/storagemetric_string.go index 21fa89e1c..e40b33a58 100644 --- a/cmd/storagemetric_string.go +++ b/cmd/storagemetric_string.go @@ -46,8 +46,9 @@ const _storageMetric_name = "MakeVolBulkMakeVolListVolsStatVolDeleteVolWalkDirLi var _storageMetric_index = [...]uint16{0, 11, 18, 26, 33, 42, 49, 56, 64, 74, 84, 98, 108, 118, 128, 134, 148, 158, 166, 179, 192, 206, 217, 223, 230, 242, 262, 270, 280, 290, 299, 303} func (i storageMetric) String() string { - if i >= storageMetric(len(_storageMetric_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_storageMetric_index)-1 { return "storageMetric(" + strconv.FormatInt(int64(i), 10) + ")" } - return _storageMetric_name[_storageMetric_index[i]:_storageMetric_index[i+1]] + return _storageMetric_name[_storageMetric_index[idx]:_storageMetric_index[idx+1]] } diff --git a/cmd/stserrorcode_string.go b/cmd/stserrorcode_string.go index b11928350..725602611 100644 --- a/cmd/stserrorcode_string.go +++ b/cmd/stserrorcode_string.go @@ -30,8 +30,9 @@ const _STSErrorCode_name = "STSNoneSTSAccessDeniedSTSMissingParameterSTSInvalidP var _STSErrorCode_index = [...]uint16{0, 7, 22, 41, 65, 91, 118, 145, 171, 192, 219, 244, 261, 281, 297, 313} func (i STSErrorCode) String() string { - if i < 0 || i >= STSErrorCode(len(_STSErrorCode_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_STSErrorCode_index)-1 { return "STSErrorCode(" + strconv.FormatInt(int64(i), 10) + ")" } - return _STSErrorCode_name[_STSErrorCode_index[i]:_STSErrorCode_index[i+1]] + return _STSErrorCode_name[_STSErrorCode_index[idx]:_STSErrorCode_index[idx+1]] } diff --git a/cmd/xl-storage-format-v2_string.go b/cmd/xl-storage-format-v2_string.go index 61959f85d..f116188c7 100644 --- a/cmd/xl-storage-format-v2_string.go +++ b/cmd/xl-storage-format-v2_string.go @@ -20,10 +20,11 @@ const _VersionType_name = "invalidVersionTypeObjectTypeDeleteTypeLegacyTypelastV var _VersionType_index = [...]uint8{0, 18, 28, 38, 48, 63} func (i VersionType) String() string { - if i >= VersionType(len(_VersionType_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_VersionType_index)-1 { return "VersionType(" + strconv.FormatInt(int64(i), 10) + ")" } - return _VersionType_name[_VersionType_index[i]:_VersionType_index[i+1]] + return _VersionType_name[_VersionType_index[idx]:_VersionType_index[idx+1]] } func _() { // An "invalid array index" compiler error signifies that the constant values have changed. @@ -39,8 +40,9 @@ const _ErasureAlgo_name = "invalidErasureAlgoReedSolomonlastErasureAlgo" var _ErasureAlgo_index = [...]uint8{0, 18, 29, 44} func (i ErasureAlgo) String() string { - if i >= ErasureAlgo(len(_ErasureAlgo_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_ErasureAlgo_index)-1 { return "ErasureAlgo(" + strconv.FormatInt(int64(i), 10) + ")" } - return _ErasureAlgo_name[_ErasureAlgo_index[i]:_ErasureAlgo_index[i+1]] + return _ErasureAlgo_name[_ErasureAlgo_index[idx]:_ErasureAlgo_index[idx+1]] } diff --git a/internal/bucket/lifecycle/action_string.go b/internal/bucket/lifecycle/action_string.go index e3f11ee59..e4e1a3cd6 100644 --- a/internal/bucket/lifecycle/action_string.go +++ b/internal/bucket/lifecycle/action_string.go @@ -25,8 +25,9 @@ const _Action_name = "NoneActionDeleteActionDeleteVersionActionTransitionActionT var _Action_index = [...]uint8{0, 10, 22, 41, 57, 80, 100, 127, 150, 182, 193} func (i Action) String() string { - if i < 0 || i >= Action(len(_Action_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_Action_index)-1 { return "Action(" + strconv.FormatInt(int64(i), 10) + ")" } - return _Action_name[_Action_index[i]:_Action_index[i+1]] + return _Action_name[_Action_index[idx]:_Action_index[idx+1]] } diff --git a/internal/grid/debugmsg_string.go b/internal/grid/debugmsg_string.go index 52c92cb4b..b7b3d1575 100644 --- a/internal/grid/debugmsg_string.go +++ b/internal/grid/debugmsg_string.go @@ -24,8 +24,9 @@ const _debugMsg_name = "debugShutdowndebugKillInbounddebugKillOutbounddebugWaitF var _debugMsg_index = [...]uint8{0, 13, 29, 46, 62, 86, 112, 130, 151, 176} func (i debugMsg) String() string { - if i < 0 || i >= debugMsg(len(_debugMsg_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_debugMsg_index)-1 { return "debugMsg(" + strconv.FormatInt(int64(i), 10) + ")" } - return _debugMsg_name[_debugMsg_index[i]:_debugMsg_index[i+1]] + return _debugMsg_name[_debugMsg_index[idx]:_debugMsg_index[idx+1]] } diff --git a/internal/grid/handlers_string.go b/internal/grid/handlers_string.go index 454c90b87..d6c6b4c38 100644 --- a/internal/grid/handlers_string.go +++ b/internal/grid/handlers_string.go @@ -96,8 +96,9 @@ const _HandlerID_name = "handlerInvalidLockLockLockRLockLockUnlockLockRUnlockLoc var _HandlerID_index = [...]uint16{0, 14, 22, 31, 41, 52, 63, 78, 85, 92, 100, 109, 115, 126, 136, 149, 163, 176, 186, 196, 206, 213, 225, 230, 236, 256, 274, 301, 315, 328, 345, 369, 381, 391, 408, 428, 446, 456, 464, 473, 483, 493, 503, 515, 525, 543, 553, 564, 573, 586, 596, 603, 613, 625, 639, 651, 668, 682, 694, 708, 727, 749, 769, 780, 790, 797, 805, 825, 844, 857, 869, 877, 888, 904, 915, 926, 936, 949, 960, 971, 983, 994} func (i HandlerID) String() string { - if i >= HandlerID(len(_HandlerID_index)-1) { + idx := int(i) - 0 + if i < 0 || idx >= len(_HandlerID_index)-1 { return "HandlerID(" + strconv.FormatInt(int64(i), 10) + ")" } - return _HandlerID_name[_HandlerID_index[i]:_HandlerID_index[i+1]] + return _HandlerID_name[_HandlerID_index[idx]:_HandlerID_index[idx+1]] } diff --git a/internal/grid/msg_string.go b/internal/grid/msg_string.go index f89986b31..68542b21a 100644 --- a/internal/grid/msg_string.go +++ b/internal/grid/msg_string.go @@ -32,9 +32,9 @@ const _Op_name = "ConnectConnectResponsePingPongConnectMuxMuxConnectErrorDisconn var _Op_index = [...]uint8{0, 7, 22, 26, 30, 40, 55, 74, 93, 105, 117, 130, 142, 148, 155, 163, 173, 179} func (i Op) String() string { - i -= 1 - if i >= Op(len(_Op_index)-1) { - return "Op(" + strconv.FormatInt(int64(i+1), 10) + ")" + idx := int(i) - 1 + if i < 1 || idx >= len(_Op_index)-1 { + return "Op(" + strconv.FormatInt(int64(i), 10) + ")" } - return _Op_name[_Op_index[i]:_Op_index[i+1]] + return _Op_name[_Op_index[idx]:_Op_index[idx+1]] } diff --git a/internal/logger/target/loggertypes/targettype_string.go b/internal/logger/target/loggertypes/targettype_string.go index 715a9fef1..3a35bd07b 100644 --- a/internal/logger/target/loggertypes/targettype_string.go +++ b/internal/logger/target/loggertypes/targettype_string.go @@ -18,9 +18,9 @@ const _TargetType_name = "ConsoleHTTPKafka" var _TargetType_index = [...]uint8{0, 7, 11, 16} func (i TargetType) String() string { - i -= 1 - if i >= TargetType(len(_TargetType_index)-1) { - return "TargetType(" + strconv.FormatInt(int64(i+1), 10) + ")" + idx := int(i) - 1 + if i < 1 || idx >= len(_TargetType_index)-1 { + return "TargetType(" + strconv.FormatInt(int64(i), 10) + ")" } - return _TargetType_name[_TargetType_index[i]:_TargetType_index[i+1]] + return _TargetType_name[_TargetType_index[idx]:_TargetType_index[idx+1]] }