File tree Expand file tree Collapse file tree 1 file changed +34
-4
lines changed
Expand file tree Collapse file tree 1 file changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -5,15 +5,15 @@ sidebar:
55 nav : go-sdk
66---
77
8- # 环境说明
8+ ## 环境说明
99
1010* 操作系统: CentOS Linux release 8.2.2004 (Core)
1111* 内核版本:Linux 10-23-173-45 4.18.0-193.el8.aarch64
1212* go 版本: [ go1.15.6.linux-arm64.tar.gz] ( https://golang.google.cn/dl/go1.15.6.linux-arm64.tar.gz )
1313
1414** 注意:go源码选择 arm 平台的,而非 amd**
1515
16- # 1. 环境准备
16+ ## 1. 环境准备
1717
1818### 1.1 go 安装
1919
@@ -65,11 +65,41 @@ export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
6565
6666 ``` shell
6767 go get github.com/ufilesdk-dev/ufile-gosdk
68- cd example; go run demo_file.go
68+ cd $GOPATH /src/github.com/ufilesdk-dev/ufile-gosdk/example
69+ # 配置config.json.example,按其中的说明填写相应参数,并将改文件重命名为config.json
70+ vim config.json.example; mv config.json.example config.json
71+ go run demo_file.go
6972 ```
7073</div >
7174
72- ![ image-20201209171357007] ( img/image-20201209171357007.png )
75+ ## 3.在arm平台编译可执行文件
76+ <div class =" copyable " markdown =" 1 " >
77+
78+ ``` shell
79+ go build demo_file.go # 编译
80+ ./demo_file # 执行
81+ ```
82+ </div >
83+
84+
85+ ![ image-20201209171357007] ( img/image-20201209171357007.png )
86+
87+ ## 4. 在Linux平台编译arm平台可执行文件,并在arm平台运行
7388
89+ ### 4.1 Linux 环境说明
7490
91+ * 操作系统: CentOS Linux release 8.2.2004 (Core)
92+ * 内核版本:Linux 10-9-61-186 4.18.0-193.28.1.el8_2.x86_64
93+ * go 版本: [ go1.15.6.linux-amd64.tar.gz] ( https://golang.google.cn/dl/go1.15.6.linux-amd64.tar.gz )
94+
95+ ### 4.2 编译并运行
96+ <div class =" copyable " markdown =" 1 " >
97+
98+ ``` shell
99+ # 在Linux平台编译arm平台可执行文件
100+ CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build demo_file.go
101+ # 在arm平台中有config.json的目录下运行
102+ ./demo_file
103+ ```
104+ </div >
75105
You can’t perform that action at this time.
0 commit comments