go (three)

Some go language specification:

(1) Package name: keep the package name and directory consistency, try to get a meaningful package name, a brief, meaningful, and standard libraries do not conflict, such as fmt

(3) variable names, function names, constant names: The Hump

(2) If the variable names, function names, constant names capitalized, other packages can be accessed, if the first letter lowercase, this package can only be accessed. (Simple to understand: uppercase public, smaller privately owned)

 

Operator (go without ternary operator)

Just write java and operators of local differences

(1) golang the + and - can be used independently, and can not be used in conjunction with any operator, such as "=", ">", and the like. And ++ and - can only appear in the variable

The following are collected at the wrong wording 
i ++> 10 
var A = i ++ // this does not work, i ++ can be used independently
++ i // such an approach is wrong, so you can write in java, but in golang ++ - can only be written after the variable

 (2) golang assignment operator, more than the number of java

 Bitwise Operators

Other Operators

 

Guess you like

Origin www.cnblogs.com/songcuiting/p/11426972.html