You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Styles:
slice := make([]type)
slice := []type{}
There is also a way of having a non-initialized slice (which should be preferred over the empty slice w/o len and cap in most cases), but this is beyond the scope of this linter
Describe the solution you'd like
I'd like to introduce a new linter that will enforce a particular style of these 3 to be used.
Things to take into account:
slices with elements (i.e. []type{el1, el2, elN}) - they should be ignored by the linter.
slices with explicit len and (optionally) capacity: i.e. make([]type, len), make([]type, len, cap) - they should be ignored by the linter.
Describe alternatives you've considered
I wasn't able to find any working alternative.
Additional context
This can be considered as a follow up feature for #892.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Styles:
There is also a way of having a non-initialized slice (which should be preferred over the empty slice w/o len and cap in most cases), but this is beyond the scope of this linter
Describe the solution you'd like
I'd like to introduce a new linter that will enforce a particular style of these 3 to be used.
Things to take into account:
[]type{el1, el2, elN}
) - they should be ignored by the linter.make([]type, len)
,make([]type, len, cap)
- they should be ignored by the linter.Describe alternatives you've considered
I wasn't able to find any working alternative.
Additional context
This can be considered as a follow up feature for #892.
The text was updated successfully, but these errors were encountered: