What is default value of a global and local variable in go?
Answer / Prabhanjan Kumar
The default value of an uninitialized global variable in Go is the zero value of its type. For example, for numeric types like int, float, etc., the default value is 0, while for strings it's empty (""). Local variables are not initialized by default and will cause a compile-time error if used before assignment.
| Is This Answer Correct ? | 0 Yes | 0 No |
What is range keyword?
Does go (golang) support pointer arithmetic?
What is syntax like in go?
Does golang support operator overloading?
What is the gopath environment variable?
How can an entry be deleted from a map?
Why type assertion is used in go language?
What is go interfaces?
What is the default value of a pointer variable in go?
How a pointer is represented in go?
Does go programming language support operator overloading?
What are interfaces to go language?