-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
123 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 75 additions & 0 deletions
75
i18n/en/docusaurus-plugin-content-docs-quick/current/0-快速开始/0-下载与使用.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
--- | ||
slug: '/' | ||
title: '下载与使用en' | ||
hide_title: true | ||
sidebar_position: 0 | ||
--- | ||
|
||
大家好,欢迎访问 `GoFrame` 框架的快速开始章节! | ||
由于 `GoFrame` 是一款模块化、低耦合设计的开发框架,包含了常用的基础组件和开发工具,既可以作为完整的业务项目框架使用也可以作为独立的组件库使用。 | ||
|
||
我们本章节从框架的下载安装使用开始,到指导大家完成一个较完善的`Web Server`接口开发。 | ||
|
||
|
||
:::info | ||
如果您还未准备好`Go`语言开发环境,建议您先查阅环境安装文档:[环境安装](/docs/install-go) | ||
了解一些基础的`Go`语言知识再进行下一步。 | ||
::: | ||
|
||
## 限制 | ||
|
||
为保证框架的稳定性和安全性,`GoFrame`框架要求的最低的基础`Go`语言版本通常会比最新的`Go`语言版本低`1~3`个版本。 | ||
|
||
当前最新框架版本要求的最低`Go`语言版本: | ||
```bash | ||
golang版本 >= 1.20 | ||
``` | ||
|
||
## 安装 | ||
您可以通过以下方式安装框架最新版本: | ||
```bash | ||
go get -u -v github.com/gogf/gf/v2 | ||
``` | ||
|
||
通常,在项目的 `go.mod` 中包含并使用 `GoFrame` 的最新版本: | ||
|
||
```bash | ||
require github.com/gogf/gf/v2 latest | ||
``` | ||
:::note | ||
- 如果您使用的是`Goland IDE`,那么在修改`go.mod`后等待片刻,`IDE`将会自动下载更新最新的`GoFrame`版本。 | ||
- 如果您使用的是其他`IDE`,在修改`go.mod`后,你可以在项目目录下执行: | ||
```bash | ||
go mod tidy | ||
``` | ||
下载更新最新的`GoFrame`版本。 | ||
::: | ||
|
||
## 运行 | ||
|
||
我们尝试运行以下代码: | ||
```go title="main.go" | ||
package main | ||
import ( | ||
"fmt" | ||
"github.com/gogf/gf/v2" | ||
) | ||
func main() { | ||
fmt.Println("Hello GF:", gf.VERSION) | ||
} | ||
``` | ||
这段简单的代码示例是打印当前引入的`GoFrame`框架版本。通过以下命令执行: | ||
```bash | ||
go run main.go | ||
``` | ||
您将会在终端看到: | ||
```bash | ||
Hello GF: v2.7.4 | ||
``` | ||
|
||
恭喜您!这表示您已经成功引用了`GoFrame`到当前项目中。 | ||
|
||
下一步,我们将使用`GoFrame`开发一个简单的`HTTP Server`服务。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
title: '开发手册en' | ||
sidebar_position: 0 | ||
--- |