Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the default value of a local variable in go?



What is the default value of a local variable in go?..

Answer / Harshit Kumar Vishnoi

The default value of a local variable in Go depends on its data type. For example, integer types like int and int8 have a default value of 0, float64 has a default value of 0.0, boolean is false, pointers are nil, structs and arrays are initialized to their zero values (which means all fields are set to their respective zero values), and interfaces and function type variables are nil.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Go Programming Language Interview Questions

What is cgo golang?

1 Answers  


List out the built in support in go?

1 Answers  


What is gopath environment variable in go programming?

1 Answers  


What are goroutines?

1 Answers  


What is the usage of goto statement in go programming language?

1 Answers  


Explain static type declaration of variable in go programming language?

1 Answers  


What is default value of a global and local variable in go?

1 Answers  


What is type casting in golang?

1 Answers  


Explain why type assertion is used in go language?

1 Answers  


Does go (golang) support type inheritance?

1 Answers  


What is l-value and r-value in go?

1 Answers  


What type assertion is used for and how it does it?

1 Answers  


Categories