goc
goc copied to clipboard
Why validatePackageForBuild only allow . as package name?
For my project, main.go file is inside different directory whereas go.mod file is in different folder. When I am doing the goc build and passing the package path as ./cmd/server
, it returns error as below:
time="2022-05-26T11:38:46Z" level=error msg="packages only support \".\"" file="[build/build.go:74]"
time="2022-05-26T11:38:46Z" level=fatal msg="Fail to build: packages only support \".\"" file="[cmd/build.go:68]"
The command '/bin/sh -c goc build --center=http://127.0.0.1:7777 --agentport=:8500 --output=bin/server ./cmd/server --debug' returned a non-zero code: 1
How to resolve it?
see: #152
Actually, it's a trade-off to support compiling single service only under main
package. we originally think that user may choose goc install ./...
to compile multi services if they want.
There are some works to let goc
to align with go build [packges]
. And of course, we appreciate very much if you wish to contribute. @ankitjain1510
七牛的兄弟们, 什么时候支持一下这个问题啊
@CarlJi Do you have a plan to support this enhancement? Most of our builds are done using command
go build -mod=vendor -o bin/Core ./cmd/server
.
If not, can you suggest any workaround regarding how to use goc build
command to generate the instrumented binary?