mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-19 18:32:23 +00:00
accounts/abi: empty string case
This commit is contained in:
parent
be4a694003
commit
ce0552a574
1 changed files with 4 additions and 0 deletions
|
|
@ -392,6 +392,10 @@ func capitalise(input string) string {
|
||||||
|
|
||||||
// decapitalise makes a camel-case string which starts with a lower case character.
|
// decapitalise makes a camel-case string which starts with a lower case character.
|
||||||
func decapitalise(input string) string {
|
func decapitalise(input string) string {
|
||||||
|
if len(input) == 0 {
|
||||||
|
return input
|
||||||
|
}
|
||||||
|
|
||||||
goForm := abi.ToCamelCase(input)
|
goForm := abi.ToCamelCase(input)
|
||||||
return strings.ToLower(goForm[:1]) + goForm[1:]
|
return strings.ToLower(goForm[:1]) + goForm[1:]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue