Unused local constants not a compiler error

112 views
Skip to first unread message

will....@gmail.com

unread,
May 2, 2024, 5:47:56 PMMay 2
to golang-nuts
Was this always the case? Is this a bug? Seems like it should be a compiler error, like unused local variables.

Ian Lance Taylor

unread,
May 2, 2024, 6:18:02 PMMay 2
to will....@gmail.com, golang-nuts
On Thu, May 2, 2024 at 2:48 PM will....@gmail.com <will....@gmail.com> wrote:
>
> Was this always the case? Is this a bug? Seems like it should be a compiler error, like unused local variables.

Yes, it's always been the case. It would probably be painful to change it now.

Ian

Marcello H

unread,
May 3, 2024, 4:13:43 AMMay 3
to golang-nuts
In golanglint_ci, there's a 'unused' linter, which will detect unused const vars too.

Op vrijdag 3 mei 2024 om 00:18:02 UTC+2 schreef Ian Lance Taylor:
Reply all
Reply to author
Forward
0 new messages