The statementvar age intdeclares a variable namedageof typeint. We have not assigned any value to this variable. If a variable is not assigned any value, Go automatically initializes it with thezero valueof the variable’s type. In this case, age is assigned the value0, which is the ze...
Now we have a variabledefaultNameof typestringand another variablecustomNameof typemyString. Even though we know thatmyStringis an alias ofstring, Go’s strong typing policy disallows variables of one type to be assigned to another.Hence the assignmentcustomName = defaultNameis not allowed and th...