Skip to content

Allow enable on constructors like NewXXX #74

@pengubco

Description

@pengubco

I ran into some nil pointer bug which was caused by pattern like this.

func NewXXX(client Client, x X,  y Y) *A {
 return &A{
   x: x,   
   y: y 
 }
}  

The nil pointer was from code r.client.Foo(). That leads me to unparam which could've have reported I forgot to set client.
However, unparam recommended to rurn off -exported. I wonder whether we can turn on just those constructors like NewxXX.
How do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions