Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

有问题如何快速解决? #13

Closed
sjqzhang opened this issue Jan 31, 2019 · 1 comment
Closed

有问题如何快速解决? #13

sjqzhang opened this issue Jan 31, 2019 · 1 comment

Comments

@sjqzhang
Copy link
Owner

sjqzhang commented Jan 31, 2019

大家有问题时,解决办法:
一、先阅读一下QA
二、看一下已关闭的issue 有没有相关的回答 如果没有就加QQ群,在群里问,看看有没有人遇到相关问题。

@sjqzhang sjqzhang pinned this issue Jun 19, 2020
Repository owner deleted a comment from zoucunjie Jun 19, 2020
@chenhj520
Copy link

最近公司进行安可测试
项目中使用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

@sjqzhang sjqzhang unpinned this issue Apr 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants