From b218c52d6eb24c0d4ab52f96fd61f49478bdb765 Mon Sep 17 00:00:00 2001 From: Spirale <2635131263@qq.com> Date: Mon, 6 Jul 2026 23:33:39 +0800 Subject: [PATCH] init repo:lab --- .gitignore | 30 ++++++++++++++++++++++++++++++ README.md | 14 ++++++++++++++ go/README.md | 24 ++++++++++++++++++++++++ go/go.mod | 3 +++ 4 files changed, 71 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100644 go/README.md create mode 100644 go/go.mod diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..f4c4eee --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..8a19020 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +# lab + +个人学习 / 练手代码仓库。按**语言分层**组织:每种语言一个顶层目录,各自管理依赖、互不干扰。 + +## 当前语言 + +- `go/` — Go(共用一个 module,约定见 [go/README.md](go/README.md)) +- `dart/` — Dart + +## 约定 + +- **顶层一个目录 = 一种语言**。新增语言直接建目录(如 `python/`、`rust/`),自行管理其依赖文件。 +- 语言内部按主题分子目录;具体约定见各语言目录下的 `README.md`。 +- **笔记**:和某个实验强相关的说明,写在该程序目录的 `README.md`;系统性知识笔记放独立笔记仓库,不混进代码仓库。 diff --git a/go/README.md b/go/README.md new file mode 100644 index 0000000..5210d12 --- /dev/null +++ b/go/README.md @@ -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` 即可。 \ No newline at end of file diff --git a/go/go.mod b/go/go.mod new file mode 100644 index 0000000..861c0f9 --- /dev/null +++ b/go/go.mod @@ -0,0 +1,3 @@ +module lab + +go 1.26.2