Skip to content

Commit d10e97c

Browse files
committed
update
1 parent 188efc0 commit d10e97c

File tree

6 files changed

+20
-0
lines changed

6 files changed

+20
-0
lines changed
File renamed without changes.
File renamed without changes.

EN/struct.md renamed to EN/struct/struct.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# struct
22

3+
Structure address:
4+
Pointer address of a struct variable == pointer address of the first element of the struct.
5+
6+
# structure sequence number notes
7+
8+
golang USES gob to serialize struct objects to be saved locally:
9+
**it's important to note that golang USES gob ```"encoding/gob"``` to serialize and there's a little bit of a pit, which is that the fields in the struct have to be exportable which is capital**
10+
The application scenario where the gob code serializes the struct object to be saved locally I think is that the small application needs to save the data locally (such as configuration files, etc.) so that it doesn't need to be used
11+
SQL database, you can easily deploy the application.
12+
313
### The underlying implementation of the object-oriented Class class is in some ways a structure, and references to objects are pointers, but the language encapsulates them.
414

515
The flexibility of Golang's Struct structure (originally derived from C, but different from C):
File renamed without changes.
File renamed without changes.

zh_CN/struct.md renamed to zh_CN/struct/struct.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# struct
22

3+
# 结构体地址:
4+
结构体变量的指针地址 == 结构体首个元素的指针地址。
5+
6+
# 结构体序列号注意事项
7+
8+
golang利用gob序列化struct对象保存到本地:
9+
**务必注意的是golang使用gob```"encoding/gob"```序列化有个小坑,就是struct里的字段必须要可导出也就是首字母大写**
10+
gob编码序列化struct对象保存到本地的应用场景我想是小应用需要保存数据在本地(比如配置文件等),这样就不需要用到
11+
sql数据库,可以简单部署应用.
12+
313
### 面向对象Class类的底层实现从某些方面说就是结构体,对象的引用就是指针,只是语言把他们封装起来了而已。
414

515
Golang的Struct结构体(源于C语言,但又有别于C)的灵活性:

0 commit comments

Comments
 (0)