Search code examples
variablesgoscopes

Does capitalization affect variables within a function block in golang?


If I declare a variable or parameter in a function, does capitalization have any affect or meaning?

Obviously for methods and variables outside of functions it exports them, but what about the above?


Solution

  • Variables declared inside a function block are always private, or unexported. Capitalization has no effects in this case.