You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import (
"say/work/v1"
)
funcmain() {
v1.SayToBob()
}
run main.go go run /root/work/go/src/say/work/main.go
go run main.go
hello Bob
that's right
but in fact, i need to build SayToBob as plugin to hot reload,run go build -buildmode=plugin -o /root/work/go/src/say/work/v1/plugin.so /root/work/go/src/say/work/v1/v1.go
missing or invalid package binary for binary-only package say
What did you expect to see?
can build plugin
What did you see instead?
can't build plugin missing or invalid package binary for binary-only package say
did I do something wrong? thanks!
The text was updated successfully, but these errors were encountered:
hello jerrybean
Have you solved the problem
I had the same problem
my golang version is 1.9.2
How can I solve this problem
go build -buildmode=plugin -o test.so *.go
missing or invalid package binary for binary-only package
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.8.3 linux/amd64
What operating system and processor architecture are you using (
go env
)?GOARCH="amd64"
GOBIN="/root/work/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/root/work/go"
GORACE=""
GOROOT="/usr/local/go1.8.3"
GOTOOLDIR="/usr/local/go1.8.3/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build055567438=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
What did you do?
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
I try to build it to .a file
go build -i -o $GOPATH/pkg/linux_amd64/say.a
change /root/work/go/src/say/say.go to
go run /root/work/go/src/say/work/main.go
that's right
go build -buildmode=plugin -o /root/work/go/src/say/work/v1/plugin.so /root/work/go/src/say/work/v1/v1.go
missing or invalid package binary for binary-only package say
What did you expect to see?
can build plugin
What did you see instead?
can't build plugin
missing or invalid package binary for binary-only package say
did I do something wrong? thanks!
The text was updated successfully, but these errors were encountered: