Skip to content

Commit

Permalink
remove array suffix
Browse files Browse the repository at this point in the history
  • Loading branch information
mdymalla committed Jul 16, 2024
1 parent 26688a3 commit e8ebe06
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion signer/core/apitypes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,12 @@ func (t *Type) isArray() bool {
// typeName returns the canonical name of the type. If the type is 'Person[]', then
// this method returns 'Person'
func (t *Type) typeName() string {
re := regexp.MustCompile(`\[\d*\]`)

if strings.HasSuffix(t.Type, "[]") {
return strings.TrimSuffix(t.Type, "[]")
return re.ReplaceAllString(t.Type, "")
}

return t.Type
}

Expand Down

0 comments on commit e8ebe06

Please sign in to comment.