Tag:variable declaration

  • Variable declaration and assignment in go language

    Time:2021-7-14

    1. Variable declaration and assignment syntax Variable declaration in go language uses the keyword VaR, such as Copy codeThe code is as follows: Var name string / / declare variableName = “Tom” / / assign a value to a variable Here, VaR is the keyword to define the variable, name is the variable name, string […]

  • Three ways to declare golang variables

    Time:2021-5-10

    There are three ways to declare variables in golang  One is to use VaR keyword to declare package level or function level variables;  The second is to use the short variable declaration method, which can only declare function level variables and need to specify the variable value;  Third, the const keyword is used to declare […]