diff --git a/README.en.md b/README.en.md new file mode 100644 index 0000000000000000000000000000000000000000..322c166a5d4793abcfd63bf525d659a98242b3ac --- /dev/null +++ b/README.en.md @@ -0,0 +1,51 @@ +# Golang Learning Examples + +This is a sample project for learning the Go language, containing demonstrations of various basic syntax elements and programming concepts. Each directory usually focuses on a specific topic, making it suitable for beginners to progressively learn the Go programming language. + +## Project Structure + +The project contains multiple directories, each demonstrating different aspects of the Go programming language, including but not limited to: + +- Basic syntax (such as variables, constants, data types) +- Control structures (such as conditional statements, loops) +- Functions and methods +- Data structures (such as arrays, slices, maps) +- Pointers and recursion +- Structs and type conversion + +## How to Use + +Each directory contains one or more `.go` files, with the `main()` function serving as the entry point of the program. You can navigate to any directory and run the following command to execute the program: + +```bash +go run filename.go +``` + +## Example Directory Descriptions + +- **array**: Demonstrates the use of arrays. +- **condition**: Demonstrates the use of conditional statements. +- **constlearn**: Demonstrates constants. +- **datatype**: Demonstrates data types. +- **function**: Examples of function definitions and usage. +- **helloworld**: The classic "Hello, World!" program. +- **loop**: Demonstrates loop structures. +- **map**: Demonstrates the use of maps. +- **method**: Demonstrates method definitions and usage. +- **operator**: Demonstrates the use of operators. +- **pointer**: Demonstrates pointers. +- **range**: Demonstrates the use of the `range` keyword in loops. +- **recursive**: Examples of recursive functions. +- **slice**: Demonstrates slices. +- **struct**: Demonstrates struct definitions and usage. +- **typeTransfor**: Demonstrates type conversion. +- **variable**: Demonstrates variables. +- **variablescope**: Demonstrates variable scope. + +## Contribution + +Pull Requests are welcome to improve these examples or add new learning materials. Please ensure you follow the project's code style and provide clear documentation. + +## License + +This project is licensed under the MIT License. For details, please refer to the LICENSE file in the project. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000000000000000000000000000000000000..7d31d6316c8ca2795a0a944cfc3b7758c32ec42f --- /dev/null +++ b/README.md @@ -0,0 +1,51 @@ +# Golang 学习示例 + +这是一个用于学习 Go 语言的示例项目,包含了多个基础语法和编程概念的演示。每个目录通常专注于一个特定的主题,适合初学者逐步学习 Go 编程语言。 + +## 项目结构 + +该项目包含多个目录,每个目录演示了 Go 编程语言的不同方面,包括但不限于: + +- 基本语法(如变量、常量、数据类型) +- 控制结构(如条件语句、循环) +- 函数和方法 +- 数据结构(如数组、切片、映射) +- 指针和递归 +- 结构体和类型转换 + +## 如何使用 + +每个目录包含一个或多个 `.go` 文件,其中 `main()` 函数作为程序的入口点。您可以进入任意目录并运行以下命令来执行程序: + +```bash +go run 文件名.go +``` + +## 示例目录说明 + +- **array**: 演示数组的使用。 +- **condition**: 条件语句的使用。 +- **constlearn**: 常量的学习。 +- **datatype**: 数据类型的演示。 +- **function**: 函数定义和使用的示例。 +- **helloword**: 经典的 "Hello, World!" 程序。 +- **loop**: 循环结构的使用。 +- **map**: 映射(map)的使用。 +- **method**: 方法的定义和使用。 +- **operator**: 运算符的使用。 +- **pointor**: 指针的学习。 +- **range**: `range` 关键字在循环中的使用。 +- **resursive**: 递归函数的示例。 +- **slice**: 切片的使用。 +- **struct**: 结构体的定义和使用。 +- **typeTransfor**: 类型转换的演示。 +- **variable**: 变量的使用。 +- **variablescope**: 变量作用域的演示。 + +## 贡献 + +欢迎提交 Pull Request 来改进这些示例或添加新的学习材料。请确保遵循项目的代码风格,并提供清晰的文档说明。 + +## 许可证 + +本项目采用 MIT 许可证。详情请查看项目中的 LICENSE 文件。 \ No newline at end of file