|
@@ -137,5 +137,69 @@
|
|
|
go version go1.18beta1 darwin/arm64
|
|
|
|
|
|
|
|
|
--
|
|
|
+
|
|
|
+
|
|
|
+- go语言主要特征
|
|
|
+
|
|
|
+ - 首字符可以是任意的Unicode字符或者下划线;剩余字符可以是Unicode字符、下划线、数字
|
|
|
+
|
|
|
+- 关键字
|
|
|
+
|
|
|
+- ```
|
|
|
+ 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
|
|
|
+ ```
|
|
|
+
|
|
|
+- 保留字
|
|
|
+
|
|
|
+- ```shell
|
|
|
+ Constants: true false iota nil
|
|
|
+
|
|
|
+ Types: int int8 int16 int32 int64
|
|
|
+ uint uint8 uint16 uint32 uint64 uintptr
|
|
|
+ float32 float64 complex128 complex64
|
|
|
+ bool byte rune string error
|
|
|
+
|
|
|
+ Functions: make len cap new append copy close delete
|
|
|
+ complex real imag
|
|
|
+ panic recover
|
|
|
+ ```
|
|
|
+
|
|
|
+- 可见性
|
|
|
+
|
|
|
+- ```
|
|
|
+ 1)声明在函数内部,是函数的本地值,类似private
|
|
|
+ 2)声明在函数外部,是对当前包可见(包内所有.go文件都可见)的全局值,类似protect
|
|
|
+ 3)声明在函数外部且首字母大写是所有包可见的全局值,类似public
|
|
|
+ ```
|
|
|
+
|
|
|
+- 声明方式:var(声明变量), const(声明常量), type(声明类型) ,func(声明函数)。
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+- 包管理 mod
|
|
|
+- 编译
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+---
|
|
|
+
|
|
|
+- Golang内置类型和函数
|
|
|
+
|
|
|
+ - 值类型
|
|
|
+
|
|
|
+ - ```
|
|
|
+ bool
|
|
|
+ int(32 or 64), int8, int16, int32, int64
|
|
|
+ uint(32 or 64), uint8(byte), uint16, uint32, uint64
|
|
|
+ float32, float64
|
|
|
+ string
|
|
|
+ complex64, complex128
|
|
|
+ array -- 固定长度的数组
|
|
|
+ ```
|
|
|
+
|
|
|
+ -
|
|
|
|