Am Mittwoch, 14. September 2016 15:43:14 UTC+2 schrieb Markus Zimmermann:
>
> On Wednesday, September 14, 2016 at 3:37:10 PM UTC+2, Alan Donovan wrote:
>>
>> On 14 September 2016 at 09:32, Markus Zimmermann <zim...@gmail.com> 
>> wrote:
>>>
>>> Do you think this might be worth bringing up in golang-dev?
>>>
>>
>> No.  We can't make this change to the language without breaking existing 
>> programs.
>>
>
> That is unfortunately. I will just write a linter check for that. Thanks 
> for the talk!
>

I think it is perfectly fine to have constants which are unused inside a 
package:
A package exporting just a bunch of physical constants (think of c, alpha, 
h, ...)
but not using any of them seems useful and not a sign of an error or even a 
hint
for current or future problems.

Regarding UNexported constants: I could imagine myself defining some
physical constants from other constants, e.g.
  const RK = 25812.8074555
  const rk = h/(e*e)
with the exported RK the official measured value and rk the value as 
computed
(from other constants).
Now rk serves as a nice documentation and test can compare RK and rk and
do some sanity checking (for this rk could live in a _test.go file, I know 
and
would be used.)

V.

 

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to