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?
I ran into some nil pointer bug which was caused by pattern like this.
The nil pointer was from code
r.client.Foo(). That leads me tounparamwhich 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 likeNewxXX.How do you think?