variable-declaration
path: courses/go-course/variable-declaration.md
- **fileName**: variable-declaration
- **Created on**: 2024-08-23 20:32:20
there is two way to declaration a variable in go
example*
var username string
username = "yosssef"
// in one line go do it
var username string = "yossef"
**second way example: **
username := "yossef"
- hint that second way can't useing the variable outside the scope of the declaration instade of the first way can declara a variable than using in any place but must to not outside the scope of declaration !!
data types:
This style of code can be slow and annoying to read. When Go developers stray from the “default” type for any given type family, the code can get messy quickly. Unless you have a good performance related reason, you'll typically just want to use the "default" types:
bool
string
int
uint
byte
rune
float64
complex128
*now see more info about the datatypes: *
dataTypes-go.md
continue:dataTypes-go.md
before:string-format-go.md