A difference:

   - it isn't possible to derive the address of a named variable from the 
   address of another named variable
   - it is possible to derive the value of a named const from another named 
   const

const (
    a = 0   // b-1, c-2
    b = 1   // a+1, c-1
    c = 2   // a+2, b+1
)

Reflection needs to be put aside because it can be made to access almost 
anything we want.

On Monday, September 12, 2016 at 2:57:15 PM UTC+2, Markus Zimmermann wrote:
>
> Hi gophers!
>
> I am wondering why we have a "declared and not used" compile error for 
> variables [https://play.golang.org/p/KLzHVO5L7q] but not for constants [
> https://play.golang.org/p/JG9dSa_VKg]? I am sure there is some rational 
> decision behind this that I have missed, but my Google-fu is just not 
> strong enough to find an answer.
>
> Cheers,
> Markus
>

-- 
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