goc build 不支持指定main-pack路径
RT, 貌似目前goc build时无法支持指定main包的位置
Yes, since we think it may be enough to meet the following scenarios:
- compile a single binary, use
goc build .under themainpackage - compile multi services, use
goc install ./...
I am wondering do you have a strong requirement to let goc works also like go build [packages] ? @majian0012002
是的,我们代码混合了c++和go,需要在makefile中集中处理编译阶段,指定package对我们来讲是必要的。并且我认为这是一个很基础的能力,应该让goc build跟go build的使用方式尽量保持一致
Sure. Let's put this issue into backlog.
请问main方法所在文件一定要命名为main.go嘛?对编译的项目的文件路径有什么要求吗?
当前有版本支持指定编译入口了吗
Yes, since we think it may be enough to meet the following scenarios:
- compile a single binary, use
goc build .under themainpackage- compile multi services, use
goc install ./...I am wondering do you have a strong requirement to let goc works also like
go build [packages]? @majian0012002

go build -o 是支持保存输出到指定路径下的,但是这个goc build -o的话,不会保存在路径下,只会生成一个这个路径的文件,这个说明文档看起来的是有歧义的
Yes, we also use the makefile and specify each build target with the go build package. Please consider it as it's a basic capability of "go build". Otherwise, we have to leverage other solutions.
BTW, since go 1.20 support integration testing code coverage. What's the road map of this project for the future?
@kevinxutg With 1.20, I am still doubtful that Golang will support generating the code coverage remotely from the applications running in many different machines or containers.
@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?
@ankitjain1510 I have tried the so-called v2 and it looks better. Hope it can help you a little bit.
@kevinxutg Thanks for the update. Is v2.0 already released? Where can I find the documentation which will help me to try it out?
@ankitjain1510 There is a branch called "v2".
@kevinxutg I see. README in that branch https://github.com/qiniu/goc/tree/v2 is in Chinese. Is there any English README for it?
@ankitjain1510 I guess not. Maybe you can translate it by ChatGPT...