Skip to content

Commit 9a04991

Browse files
committed
Add:增加数据结构与算法
1 parent 602327f commit 9a04991

File tree

3 files changed

+39
-17
lines changed

3 files changed

+39
-17
lines changed

.DS_Store

6 KB
Binary file not shown.

README.md

+26-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
1-
## go-design-patterns
2-
3-
Go经典设计模式分享
1+
## :stars:Go设计模式&数据结构与算法
42

53
Go语言是一种高效、简洁和可靠的编程语言,它具有强大的类型系统、并发支持和简洁的语法。这些特性使得Go语言成为实现设计模式的理想选择。本仓库将探讨Go语言如何支持设计模式,并分析一些使用Go语言实现的设计模式示例。
64

7-
### 目录
5+
### :airplane:设计模式篇
86

97
#### DONE
108

@@ -41,3 +39,27 @@ Go语言是一种高效、简洁和可靠的编程语言,它具有强大的类
4139
- 模板方法模式和策略模式
4240

4341
- 工厂模式和工厂方法模式
42+
43+
- [Optional模式和Builder模式](https://mp.weixin.qq.com/s/dGqaYg1TRhII6jytsfF1Vg)
44+
45+
---
46+
47+
### :speedboat:数据结构与算法篇
48+
49+
B站视频学习:
50+
51+
https://www.bilibili.com/video/BV1Fv4y1f7T1
52+
53+
学习进度:
54+
55+
- [x] 2 / 42
56+
57+
笔记代码:
58+
59+
TODO
60+
61+
---
62+
63+
### 相关博客
64+
65+
- [这些Coding套路你不会还不知道吧?](https://cloud.tencent.com/developer/article/2329818)

blog/聊聊Go开发中常用的设计模式.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -54,19 +54,19 @@
5454
import "sync"
5555

5656
type MysqlConn struct {
57-
Addr string
57+
Addr string
5858
}
5959

6060
var (
61-
mysqlConn *MysqlConn
62-
once = sync.Once{}
61+
mysqlConn *MysqlConn
62+
once = sync.Once{}
6363
)
6464

6565
func GetMySQLConn() *MysqlConn {
66-
once.Do(func() {
67-
mysqlConn = &MysqlConn{Addr: "127.0.0.1"}
68-
})
69-
return mysqlConn
66+
once.Do(func() {
67+
mysqlConn = &MysqlConn{Addr: "127.0.0.1"}
68+
})
69+
return mysqlConn
7070
}
7171
```
7272

@@ -119,12 +119,12 @@ import (
119119
)
120120

121121
type MakeYogurtTemplate interface {
122-
CreateYogurt() //准备好酸奶
123-
CutFruit() //切水果
124-
Merge() //放在一起搅拌
125-
Optimize() //调制味道
126-
Eating() //开吃
127-
Do()
122+
CreateYogurt() //准备好酸奶
123+
CutFruit() //切水果
124+
Merge() //放在一起搅拌
125+
Optimize() //调制味道
126+
Eating() //开吃
127+
Do()
128128
}
129129

130130
type DragonFruit struct {

0 commit comments

Comments
 (0)