Skip to content

Commit a69c888

Browse files
Enable Go modules and remove GOPATH requirement from docs (#5677)
Signed-off-by: Monika Jakhar <[email protected]>
1 parent 1137f5f commit a69c888

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ PREFETCHER_VERSION := v0.1.0
1010
PACKAGE := github.com/fluid-cloudnative/fluid
1111

1212
# Go and build settings
13-
GO_MODULE ?= off
13+
GO_MODULE ?= on
1414
GC_FLAGS ?= -gcflags="all=-N -l"
1515
LOCAL_FLAGS ?= -gcflags="all=-N -l"
1616
CGO_ENABLED ?= 0

docs/en/dev/how_to_develop.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,12 @@ See [Install Docker](https://docs.docker.com/engine/install/) for more informati
2020
### Get Source Code
2121

2222
```shell
23-
$ export GOPATH=$(go env GOPATH)
24-
25-
$ mkdir $GOPATH/src/github.com/fluid-cloudnative
26-
27-
$ cd $GOPATH/src/github.com/fluid-cloudnative
28-
2923
$ git clone https://github.com/fluid-cloudnative/fluid.git
3024

3125
$ cd fluid
3226
```
3327

34-
> **NOTE**: In this document, we build, run and debug under non-module environment.
35-
>
36-
> See [Go Modules](https://github.com/golang/go/wiki/Modules) for more information if some issue occurs to you.
28+
> **NOTE**: Fluid uses Go modules for dependency management. No GOPATH setup is required.
3729
3830
### Build Binary
3931
`Makefile` under project directory provides many tasks you may want to use including Test, Build, Debug, Deploy etc.
@@ -217,7 +209,7 @@ $ ln -s $(which helm) /usr/local/bin/ddc-helm
217209

218210
2. Create a soft link directory for related Charts locally
219211
```
220-
$ ln -s $GOPATH/src/github.com/fluid-cloudnative/fluid/charts $HOME/charts
212+
$ ln -s $(pwd)/charts $HOME/charts
221213
```
222214

223215
3. Taking the Alluxio Runtime Controller as an example, run the component locally using the following command:

docs/zh/dev/how_to_develop.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,12 @@ Fluid需要使用`make`命令进行项目构建,使用以下命令安装`make`
2121

2222
### 获取项目源码
2323
```
24-
$ export GOPATH=$(go env GOPATH)
25-
26-
$ mkdir $GOPATH/src/github.com/fluid-cloudnative
27-
28-
$ cd $GOPATH/src/github.com/fluid-cloudnative
29-
3024
$ git clone https://github.com/fluid-cloudnative/fluid.git
3125
3226
$ cd fluid
3327
```
3428

35-
> **注意**:本文在非Go Module模式下完成Fluid的编译、运行和调试。
36-
>
37-
> 有关Go module可以参阅 [Golang 官方文档](https://github.com/golang/go/wiki/Modules) 获取更多信息。
29+
> **注意**:Fluid使用Go Module进行依赖管理,无需配置GOPATH。
3830
3931
### 安装`controller-gen`
4032

@@ -49,7 +41,7 @@ $ make controller-gen
4941
$ controller-gen --version
5042
Version: v0.8.0
5143
```
52-
> **注意**: controller-gen默认将下载到`$GOPATH/bin`路径下,请确保`$GOPATH/bin`已被添加在开发环境的`$PATH`环境变量中
44+
> **注意**: controller-gen默认将下载到`$(go env GOPATH)/bin`路径下,请确保该路径已被添加在开发环境的`$PATH`环境变量中
5345
5446
### 二进制程序编译
5547

@@ -115,7 +107,7 @@ $ ln -s $(which helm) /usr/local/bin/ddc-helm
115107

116108
2. 在本地创建相关Charts的软链接目录
117109
```
118-
$ ln -s $GOPATH/src/github.com/fluid-cloudnative/fluid/charts $HOME/charts
110+
$ ln -s $(pwd)/charts $HOME/charts
119111
```
120112

121113
3. 以Alluxio Runtime Controller为例,使用以下命令在本地运行该组件:

0 commit comments

Comments
 (0)