Skip to content

getTagName function uses strings.TrimLeft instead of TrimPrefix #813

Closed
@GrosQuildu

Description

@GrosQuildu

Describe the bug

In the code below the "name=" string is a cutset (a set of characters) to be removed, and not a prefix.

revive/rule/struct-tag.go

Lines 139 to 140 in b03e54f

if strings.HasPrefix(option, "name=") {
return strings.TrimLeft(option, "name=")

getTagName function will return o instead of ameno for the this struct tag: protobuf:"varint,name=ameno".

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions