init repo:lab

This commit is contained in:
Spirale 2026-07-06 23:33:39 +08:00
commit b218c52d6e
4 changed files with 71 additions and 0 deletions

30
.gitignore vendored Normal file
View 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
View 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
View 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` 即可。

3
go/go.mod Normal file
View File

@ -0,0 +1,3 @@
module lab
go 1.26.2