account/abi: convert if-else-if chain to tagged switch (#27869)

account/abi: conver if-else-if chain to tagged switch
This commit is contained in:
Shude Li
2023-08-23 09:53:38 -04:00
committed by GitHub
parent 4af98d4ee6
commit 76d4ac1acb
3 changed files with 12 additions and 9 deletions
+4 -3
View File
@@ -84,11 +84,12 @@ func TestMethodString(t *testing.T) {
for _, test := range table {
var got string
if test.method == "fallback" {
switch test.method {
case "fallback":
got = abi.Fallback.String()
} else if test.method == "receive" {
case "receive":
got = abi.Receive.String()
} else {
default:
got = abi.Methods[test.method].String()
}
if got != test.expectation {