From d029548b706d9e92466236ed59a14051ff964ff5 Mon Sep 17 00:00:00 2001 From: gitee-bot Date: Sat, 30 Aug 2025 10:59:04 +0000 Subject: [PATCH] Add README.md --- README.en.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 112 insertions(+) create mode 100644 README.en.md create mode 100644 README.md diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000..58e1bfd --- /dev/null +++ b/README.en.md @@ -0,0 +1,56 @@ +# Go Design Patterns + +This project is used to demonstrate and implement various design patterns written in the Go language. Through this project, you can learn and practice common design patterns, helping to improve your design thinking and code architecture skills in Go language development. + +## Directory Structure + +- **[Creational Patterns](CreationalPatterns)** + Contains patterns related to object creation, such as Singleton, Factory, Abstract Factory, etc. + +- **[Structural Patterns](StructuralPatterns)** + Contains patterns related to object and structure composition, such as Adapter, Composite, Proxy, etc. + +- **[Behavioral Patterns](BehavioralPatterns)** + Contains patterns related to communication between objects and responsibility distribution, such as Observer, Strategy, Command, etc. + +## How to Use + +1. **Clone the Project** + ```bash + git clone https://gitee.com/xdx_coder_dev/go-design-pattern.git + ``` + +2. **Enter the Project Directory** + ```bash + cd go-design-pattern + ``` + +3. **View Specific Design Pattern Implementations** + - Each pattern is implemented in its corresponding folder. You can directly view the code and run the examples. + - For example, the Singleton pattern implementation may be located in the `CreationalPatterns/singleton` folder. + +4. **Run Examples** + - Use Go to run specific example files: + ```bash + go run CreationalPatterns/singleton/main.go + ``` + +## Contribution Guide + +If you are interested in contributing to this project, please follow these steps: + +1. Fork the project and create a new branch. +2. Add your design pattern implementation or improve existing code. +3. Submit your changes and create a Pull Request. + +## License + +This project is licensed under the MIT License. For details, please see the [LICENSE](LICENSE) file. + +## Contact + +If you have any questions or suggestions, please contact us via [Gitee](https://gitee.com/xdx_coder_dev). + +--- + +This project is suitable for developers who want to learn design patterns in the Go language. Through categorized implementations, it will help you better understand the application scenarios and implementation approaches of design patterns. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..c4a961b --- /dev/null +++ b/README.md @@ -0,0 +1,56 @@ +# Go 设计模式 + +该项目用于演示和实现各种设计模式,使用 Go 语言编写。通过此项目,您可以学习和实践常见的设计模式,帮助提升 Go 语言开发中的设计思维和代码架构能力。 + +## 目录结构 + +- **[Creational Patterns(创建型模式)](CreationalPatterns)** + 包含与对象创建相关的模式,例如单例模式、工厂模式、抽象工厂模式等。 + +- **[Structural Patterns(结构型模式)](StructuralPatterns)** + 包含与对象和结构组合相关的模式,例如适配器模式、组合模式、代理模式等。 + +- **[Behavioral Patterns(行为型模式)](BehavioralPatterns)** + 包含与对象之间通信和职责分配相关的模式,例如观察者模式、策略模式、命令模式等。 + +## 如何使用 + +1. **克隆项目** + ```bash + git clone https://gitee.com/xdx_coder_dev/go-design-pattern.git + ``` + +2. **进入项目目录** + ```bash + cd go-design-pattern + ``` + +3. **查看具体设计模式的实现** + - 每个模式都在对应的文件夹中实现,您可以直接查看代码并运行示例。 + - 例如,单例模式的实现可能位于 `CreationalPatterns/singleton` 文件夹中。 + +4. **运行示例** + - 使用 Go 运行具体示例文件: + ```bash + go run CreationalPatterns/singleton/main.go + ``` + +## 贡献指南 + +如果您有兴趣为该项目做出贡献,请遵循以下步骤: + +1. Fork 项目并创建一个新的分支。 +2. 添加您的设计模式实现或改进现有代码。 +3. 提交更改并创建一个 Pull Request。 + +## 许可证 + +该项目遵循 MIT 许可证。有关详细信息,请查看 [LICENSE](LICENSE) 文件。 + +## 联系方式 + +如果您有任何问题或建议,请通过 [Gitee](https://gitee.com/xdx_coder_dev) 与我们联系。 + +--- + +该项目适合希望学习 Go 语言设计模式的开发者。通过分门别类的实现,可以帮助您更好地理解设计模式的应用场景和实现方式。 \ No newline at end of file -- Gitee