There are various
ways to declare and assign values to variables in GoLang.
Download above code from Variable declaration example-1
As mentioned earlier there is another way of declaring variables at the time of assigning values to them. It can be called as ad-hoc declaration . The below image explains how to do that
Download above code from Variable declaration example-2
Thanks for reading, please do write your comments and correct me if some thing is wrong or some thing to be added to it. I will write advanced techniques in Go Lang in my upcoming posts..
- Declaring variables using var keyword
- Declaring variables and assigning values with a special assignment operator :=
![]() |
| Variable declaration using var keyword and assigning values |
![]() |
| Variable declaration and assign value in an ad-hoc way |
Thanks for reading, please do write your comments and correct me if some thing is wrong or some thing to be added to it. I will write advanced techniques in Go Lang in my upcoming posts..


No comments:
Post a Comment