Is var short for variable?

Thus far, var sounds interesting, but mysterious

2 Likes

haha, yes var is the reserved keyword for variable. Similarly const is for constant.

Thanks Carolyn :blush:

yes, here is a nice example for the var keyword: https://tour.golang.org/basics/8

So why do we get “false false false”

1 Like

Because false is the zero value for bool.

Intriguing

No, it’s documented as such in the language specifications:

https://golang.org/ref/spec#The_zero_value

When I said intriguing, that meant I was interested, but a little lost. Your answer however was helpful. Don’t worry, I’ll get there

1 Like

https://tour.golang.org/basics/8 When I ran the program contained herein :sweat_smile: I got 0 false false false, Why is that?

Oops, I see I already asked that question. I’ll go over the answer again.

I understand very slightly better, but I’m still a bit lost here.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.