Variable
- Variable declaration
- Variable: var foo int
- Variable with initializers: var foo int = 42
- Short variable declarations: foo := 42
- Can’t redeclare variables, but can shadow them.
- All variables must be used.
- Visibility
- Lower case first letter for package scope
- Upper case first letter to export
- No private scope
- Naming conventions
- Pascal or camelCase
- Capitalize acronyms (HTTP, URL)
- As short as reasonable
- Longer names for longer lives
- Pascal or camelCase
- Type conversion
- destinationType(variable)
- int(variable) --decimal will be lost
- float32(variable)
- use strconv package for strings
- Another topic to write details
- destinationType(variable)