Linter for immutable structure

105 views
Skip to first unread message

Vitalii Solodilov

unread,
Jun 25, 2021, 12:35:04 PM6/25/21
to golang-nuts
I have an immutable structure. It contains methods that create a new copy, modify and return it.
Are there any linters that can verify that the result of the methods will be assigned to a variable or returned from a function? I can manually specify a list of the methods.
For example, the linter will detect the following cases: https://play.golang.org/p/Aje-DeWBnKd

Reply all
Reply to author
Forward
0 new messages