Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (go version)?
1.8.3
What operating system and processor architecture are you using (go env)?
linux:
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build369711885=/tmp/go-build"
CXX="g++"
CGO_ENABLED="1"
windows:
$ go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\isource\go-workspace
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-ID:\isource\go-workspace/inclu
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-LD:\isource\go-workspace/lib
What did you do?
i build filebeat seperately in linux and windows
What did you expect to see?
the size of binary file built in linux is smaller than 30M as in windows
What did you see instead?
in linux it came to be 42M while in windows 27.7M,
even i build across in windows to get binary file using "GOOS=linux GOARCH=amd64 go build",it still came to be 27.4M.
However i need to build in linux and the size of file smaller than 30M and i use CGO.
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version)?1.8.3
What operating system and processor architecture are you using (
go env)?linux:
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build369711885=/tmp/go-build"
CXX="g++"
CGO_ENABLED="1"
windows:
$ go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=D:\isource\go-workspace
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-ID:\isource\go-workspace/inclu
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-LD:\isource\go-workspace/lib
What did you do?
i build filebeat seperately in linux and windows
What did you expect to see?
the size of binary file built in linux is smaller than 30M as in windows
What did you see instead?
in linux it came to be 42M while in windows 27.7M,
even i build across in windows to get binary file using "GOOS=linux GOARCH=amd64 go build",it still came to be 27.4M.
However i need to build in linux and the size of file smaller than 30M and i use CGO.