goc icon indicating copy to clipboard operation
goc copied to clipboard

goc build 不支持指定main-pack路径

Open majian0012002 opened this issue 4 years ago • 14 comments

RT, 貌似目前goc build时无法支持指定main包的位置

majian0012002 avatar Jan 14 '21 03:01 majian0012002

Yes, since we think it may be enough to meet the following scenarios:

  • compile a single binary, use goc build . under the main package
  • 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

CarlJi avatar Jan 17 '21 09:01 CarlJi

是的,我们代码混合了c++和go,需要在makefile中集中处理编译阶段,指定package对我们来讲是必要的。并且我认为这是一个很基础的能力,应该让goc build跟go build的使用方式尽量保持一致

majian0012002 avatar Jan 18 '21 02:01 majian0012002

Sure. Let's put this issue into backlog.

CarlJi avatar Jan 18 '21 09:01 CarlJi

请问main方法所在文件一定要命名为main.go嘛?对编译的项目的文件路径有什么要求吗?

RicardoHa avatar Apr 21 '21 09:04 RicardoHa

当前有版本支持指定编译入口了吗

Yes, since we think it may be enough to meet the following scenarios:

  • compile a single binary, use goc build . under the main package
  • 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

RunningSnail999 avatar Jun 09 '22 13:06 RunningSnail999

goc问题

go build -o 是支持保存输出到指定路径下的,但是这个goc build -o的话,不会保存在路径下,只会生成一个这个路径的文件,这个说明文档看起来的是有歧义的

cnlydia avatar Aug 16 '22 02:08 cnlydia

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 avatar Apr 09 '23 15:04 kevinxutg

@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.

ankitjain1510 avatar May 16 '23 04:05 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?

ankitjain1510 avatar May 16 '23 05:05 ankitjain1510

@ankitjain1510 I have tried the so-called v2 and it looks better. Hope it can help you a little bit.

kevinxutg avatar May 16 '23 10:05 kevinxutg

@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 avatar May 16 '23 11:05 ankitjain1510

@ankitjain1510 There is a branch called "v2".

kevinxutg avatar May 16 '23 13:05 kevinxutg

@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 avatar May 17 '23 05:05 ankitjain1510

@ankitjain1510 I guess not. Maybe you can translate it by ChatGPT...

kevinxutg avatar May 18 '23 01:05 kevinxutg