Skip to content

ToGoName may panic on some input with pluralized initialisms #158

@fredbi

Description

@fredbi

Describe the bug

Name mangler's ToGoName panics on the following inputs:

  • LinkLocalIPs
  • nativeBaseURLs

This indicates a flaw in the detection of pluralized initialisms.

Steps to Reproduce

func TestManglerToGoName_IssueXYZ(t *testing.T) {
        m := NewNameMangler()

        require.Equal(t, "LinkLocalIPs", m.ToGoName("LinkLocalIPs"))
        require.Equal(t, "NativeBaseURLs", m.ToGoName("nativeBaseURLs"))
}

Expected behavior

Actual behavior

Environment

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions