golang / tour

[mirror] A Tour of Go
BSD 3-Clause "New" or "Revised" License
1.53k stars 521 forks source link

tour: Basics - Constants #1533

Open Yagisanatode opened 10 months ago

Yagisanatode commented 10 months ago

Context: https://go.dev/tour/basics/15

Suggest a single line defining a "constant".

E.g. "A constant is a named data item with a predefined value. You cannot change the value assigned to a predefined constant. "
ref: IBM Constants and variables

mayyaannkk commented 10 months ago

Separating it into lines gives a more beginner-friendly look. Each line gives separate information about how to declare, what data type it can store, and what not to do.

Although it would be better if it also showed this

You cannot change the value assigned to a predefined constant.