errchkjson icon indicating copy to clipboard operation
errchkjson copied to clipboard

Allow to exclude the structure object if all fields are not filled in

Open Raneddo opened this issue 1 year ago • 1 comments
trafficstars

Go often uses the return-from-function approach of the form: (Type, bool) instead of (*Type)

Now linter knows how to detect when an empty object is returned along with a non-empty error, but the same doesn't work for returning a bool second parameter return

I propose to add two exception parameters:

  1. exclude-type-bool to return an empty value from a function in the format (Type, bool)
  2. exclude-empty-value for any return of an empty value (all fields of the structure are not filled)

Raneddo avatar Dec 26 '23 20:12 Raneddo

Hi @Raneddo Sorry for my slow response. I am not sure I can follow your proposal. Can you please give a code example with a description what you expect to see and what you see instead. Thanks.

breml avatar Feb 29 '24 20:02 breml