A variable can have a short name (like x and y) or a more descriptive name (age, price, carname, etc.).
Go variable naming rules:
a-z, A-Z
, 0-9
, and _
)Variable names with more than one word can be difficult to read.
There are several techniques you can use to make them more readable:
Each word, except the first, starts with a capital letter:
myVariableName = "John"
Each word starts with a capital letter:
MyVariableName = "John"
Each word is separated by an underscore character:
my_variable_name = "John"
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!