Skip to content

Commit

Permalink
update type name logic
Browse files Browse the repository at this point in the history
  • Loading branch information
mdymalla committed Jul 16, 2024
1 parent e8ebe06 commit 1dbbd56
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions signer/core/apitypes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,15 @@ func (t *Type) isArray() bool {
func (t *Type) typeName() string {
re := regexp.MustCompile(`\[\d*\]`)

if strings.HasSuffix(t.Type, "[]") {
return re.ReplaceAllString(t.Type, "")
// print input string
fmt.Println("\nInput string: ", t.Type)

if strings.Contains(t.Type, "[") {
replaced := re.ReplaceAllString(t.Type, "")
fmt.Println("\noutput string: ", replaced)
return replaced
} else {
fmt.Println("\nno changes required to output string")
}

return t.Type
Expand Down

0 comments on commit 1dbbd56

Please sign in to comment.