init repo:lab
This commit is contained in:
commit
b218c52d6e
30
.gitignore
vendored
Normal file
30
.gitignore
vendored
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# ---- Go ----
|
||||||
|
*.exe
|
||||||
|
*.exe~
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
*.test
|
||||||
|
*.out
|
||||||
|
go.work
|
||||||
|
go.work.sum
|
||||||
|
vendor/
|
||||||
|
|
||||||
|
# ---- Dart / Flutter ----
|
||||||
|
.dart_tool/
|
||||||
|
.flutter-plugins
|
||||||
|
.flutter-plugins-dependencies
|
||||||
|
.packages
|
||||||
|
.pub-cache/
|
||||||
|
.pub/
|
||||||
|
build/
|
||||||
|
|
||||||
|
# ---- IDE / 编辑器 ----
|
||||||
|
.idea/
|
||||||
|
.vscode/
|
||||||
|
*.swp
|
||||||
|
*.swo
|
||||||
|
|
||||||
|
# ---- 操作系统 ----
|
||||||
|
.DS_Store
|
||||||
|
Thumbs.db
|
||||||
14
README.md
Normal file
14
README.md
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# lab
|
||||||
|
|
||||||
|
个人学习 / 练手代码仓库。按**语言分层**组织:每种语言一个顶层目录,各自管理依赖、互不干扰。
|
||||||
|
|
||||||
|
## 当前语言
|
||||||
|
|
||||||
|
- `go/` — Go(共用一个 module,约定见 [go/README.md](go/README.md))
|
||||||
|
- `dart/` — Dart
|
||||||
|
|
||||||
|
## 约定
|
||||||
|
|
||||||
|
- **顶层一个目录 = 一种语言**。新增语言直接建目录(如 `python/`、`rust/`),自行管理其依赖文件。
|
||||||
|
- 语言内部按主题分子目录;具体约定见各语言目录下的 `README.md`。
|
||||||
|
- **笔记**:和某个实验强相关的说明,写在该程序目录的 `README.md`;系统性知识笔记放独立笔记仓库,不混进代码仓库。
|
||||||
24
go/README.md
Normal file
24
go/README.md
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
# Go 练习区
|
||||||
|
|
||||||
|
本目录是 Go 的学习 / 练手代码,共用一个 module(`go.mod` 在本目录)。
|
||||||
|
|
||||||
|
## 约定
|
||||||
|
|
||||||
|
- **每个叶子目录 = 一个独立小程序**:`package main` + `main.go`。
|
||||||
|
- 多个小程序并存互不冲突(不同目录、各自的 `main`)。
|
||||||
|
- 某个程序依赖太特殊时,可在它自己的目录单独 `go mod init`,脱离本 module。
|
||||||
|
|
||||||
|
## 主题目录
|
||||||
|
|
||||||
|
| 目录 | 放什么 |
|
||||||
|
|---|---|
|
||||||
|
| `basics/` | 语法基础、内置类型(slice / map / chan 行为等) |
|
||||||
|
| `concurrency/` | 并发:goroutine / channel / select / context |
|
||||||
|
| `stdlib/` | 标准库练习(net/http、encoding/json、io…) |
|
||||||
|
| `patterns/` | 设计模式 |
|
||||||
|
| `algorithms/` | 数据结构与算法 |
|
||||||
|
| `web/` | net/http、Gin 等框架 |
|
||||||
|
| `testing/` | 练习 Go 测试机制(`*_test.go`、`go test`、table-driven、testify) |
|
||||||
|
| `project/` | 完整小项目(多文件) |
|
||||||
|
|
||||||
|
> 主题目录可随时增删。写新程序时挑最贴的主题,在里面建一个新子目录放 `main.go` 即可。
|
||||||
Loading…
Reference in New Issue
Block a user