Comments (1)
最近公司进行安可测试
项目中使用go-fastdfs
下载源码可以编译成功,但是执行的时候提示
cannot execute binary file
查看go环境变量信息
go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/root/.cache/go-build"
GOENV="/root/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/root/go"
GOPRIVATE=""
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_arm64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build229346615=/tmp/go-build -gno-record-gcc-switches"
修改build.sh
GOARCH=amd64 改为与go环境变量中GOARCH值,如下
GOPATH=pwd
GOOS=linux GOARCH=arm64 go build -o fileserver
重新编译,解决!
参考:
https://stackoverflow.com/questions/36198418/golang-cannot-execute-binary-file-exec-format-error
from go-fastdfs.
Related Issues (20)
- 文件上传异常 HOT 1
- 修改端口号后,重启失败 HOT 2
- 没有C#的支持案例 HOT 2
- 文件去重逻辑BUG HOT 1
- 文件批量删除相关问题 HOT 1
- 同一个文件重复上传问题 HOT 1
- 下载鉴权如何添加 HOT 1
- fileserver.go异常打印语句调整 HOT 2
- 在容器下,文件去重功能失效; HOT 1
- 大文件上传断点续传,使用TusUpload 里面 TusUpload .setMetadata 里面设置auth_token 上传成功后,文件的后缀格式丢失了,MP4没有了只有文件名字
- [ERR]saveToLevelDBleveldb/table: corruption on table-footer HOT 1
- 咨询Go-fastdfs GetClientIp未授权访问漏洞修复版本 HOT 1
- 一些使用上的疑问 HOT 1
- 关于docker部署 HOT 1
- 设置文件的content-type HOT 1
- 您好上传文件后会返回一个json信息,如果想要查询历史文件的json(上传后返回的信息)有什么方式吗? HOT 1
- 如何添加白名单 HOT 2
- 设置auth_token验证 下载未生效 HOT 1
- 单节点测试 下载大文件失败
- 文件名含连续两个小数点的文件上传后无法被下载
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-fastdfs.