This is a creation in Article, where the information may have evolved or changed.
1. Code specification
u/u
| type |
Identification |
Example |
| int |
i/i |
iCount, iCount |
| bool |
b/b |
bshow, bShow |
| string |
s/s |
sName, sName |
| UINT |
ucolor, Ucolor |
| float |
f/f |
fplace, fplace |
| Pointer |
p/p |
*pname, *pname |
| struct |
stc/stc |
stcperson, Stcperson |
| array |
arr/arr |
arrhero, Arrhero |
| Slice |
slc/slc |
slihero, Slihero |
| map |
map/map |
mapperson, Mapperson |
| Const |
ALL caps |
const PI float32 = 3.14 |
| interface |
I |
imyinterface |
2.go keywords
| 2.keyword |
|
|
|
|
| Break |
Default |
Func |
Interface |
Select |
| Case |
Defer |
Go |
Map |
struct |
| Chan |
Else |
Goto |
Package |
Switch |
| Const |
Fallthrough |
If |
Range |
Type |
| Continue |
For |
Import |
Return |
Var |
3. Binary->%
| 3. Binary |
|
| Binary |
%b |
| Octal |
%o |
| Hexadecimal |
%x |
| Decimal |
%d |
| Floating point number |
%f |
| String |
%s |
The most important interface of the 1.I/O package: Reader, Writer
2.string once defined, cannot be modified.
String is a sequence of characters, not a sequence of bytes
3.slice is a pointer-to-pass address copy, rather than an array-valued copy, which is more efficient
4.new () return pointer
Make () returns the initialization value used to create the Slice,maps,channels