From 85fb9e77c40694fdf3019d1aacb3afa60b1858d8 Mon Sep 17 00:00:00 2001 From: Dmitrii Stepanov Date: Wed, 29 Mar 2023 11:41:30 +0300 Subject: [PATCH] [#185] ir: Resolve funlen linter Resolve funlen linter for GlagoliticLetter.String method Signed-off-by: Dmitrii Stepanov --- pkg/innerring/alphabet.go | 134 +++++++++++++------------------------- 1 file changed, 47 insertions(+), 87 deletions(-) diff --git a/pkg/innerring/alphabet.go b/pkg/innerring/alphabet.go index 518c1819..78930db7 100644 --- a/pkg/innerring/alphabet.go +++ b/pkg/innerring/alphabet.go @@ -52,96 +52,56 @@ const ( lastLetterNum ) +var glagolicLetterToString = map[GlagoliticLetter]string{ + az: "az", + buky: "buky", + vedi: "vedi", + glagoli: "glagoli", + dobro: "dobro", + yest: "yest", + zhivete: "zhivete", + dzelo: "dzelo", + zemlja: "zemlja", + izhe: "izhe", + izhei: "izhei", + gerv: "gerv", + kako: "kako", + ljudi: "ljudi", + mislete: "mislete", + nash: "nash", + on: "on", + pokoj: "pokoj", + rtsi: "rtsi", + slovo: "slovo", + tverdo: "tverdo", + uk: "uk", + fert: "fert", + kher: "kher", + oht: "oht", + shta: "shta", + tsi: "tsi", + cherv: "cherv", + sha: "sha", + yer: "yer", + yeri: "yeri", + yerj: "yerj", + yat: "yat", + jo: "jo", + yu: "yu", + smallYus: "small.yus", + smallIotatedYus: "small.iotated.yus", + bigYus: "big.yus", + bigIotatedYus: "big.iotated.yus", + fita: "fita", + izhitsa: "izhitsa", +} + // String returns l in config-compatible format. -// -// nolint: funlen func (l GlagoliticLetter) String() string { - switch l { - default: - return "unknown" - case az: - return "az" - case buky: - return "buky" - case vedi: - return "vedi" - case glagoli: - return "glagoli" - case dobro: - return "dobro" - case yest: - return "yest" - case zhivete: - return "zhivete" - case dzelo: - return "dzelo" - case zemlja: - return "zemlja" - case izhe: - return "izhe" - case izhei: - return "izhei" - case gerv: - return "gerv" - case kako: - return "kako" - case ljudi: - return "ljudi" - case mislete: - return "mislete" - case nash: - return "nash" - case on: - return "on" - case pokoj: - return "pokoj" - case rtsi: - return "rtsi" - case slovo: - return "slovo" - case tverdo: - return "tverdo" - case uk: - return "uk" - case fert: - return "fert" - case kher: - return "kher" - case oht: - return "oht" - case shta: - return "shta" - case tsi: - return "tsi" - case cherv: - return "cherv" - case sha: - return "sha" - case yer: - return "yer" - case yeri: - return "yeri" - case yerj: - return "yerj" - case yat: - return "yat" - case jo: - return "jo" - case yu: - return "yu" - case smallYus: - return "small.yus" - case smallIotatedYus: - return "small.iotated.yus" - case bigYus: - return "big.yus" - case bigIotatedYus: - return "big.iotated.yus" - case fita: - return "fita" - case izhitsa: - return "izhitsa" + if str, found := glagolicLetterToString[l]; found { + return str } + return "unknown" } type alphabetContracts map[GlagoliticLetter]util.Uint160