Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why use cgo? #348

Closed
Ryan-Git opened this issue Dec 30, 2018 · 6 comments · Fixed by #349
Closed

Why use cgo? #348

Ryan-Git opened this issue Dec 30, 2018 · 6 comments · Fixed by #349

Comments

@Ryan-Git
Copy link
Contributor

we can't cross-compile recently and find cgo is introduced by #312, but I can't find any ref from or to C, what is it used for?

@siddontang
Copy link
Collaborator

@Ryan-Git

If you remove cgo, can we compile the code successfully?

@Ryan-Git
Copy link
Contributor Author

@siddontang
yes. on my mac, after removing import "C" from conn.go & resp.go, all builds pass both directly and cross compile to amd64, linux

@siddontang
Copy link
Collaborator

@Ryan-Git

Can you send me a PR to remove them?

@siddontang
Copy link
Collaborator

@michael2008

Any reason to add "C" here?

@Ryan-Git
Copy link
Contributor Author

Ryan-Git commented Jan 2, 2019

@Ryan-Git

Can you send me a PR to remove them?

Sure. I'd like to wait one or two days if @michael2008 could reply.

@michael2008
Copy link
Contributor

@Ryan-Git
Can you send me a PR to remove them?

Sure. I'd like to wait one or two days if @michael2008 could reply.

Hi @Ryan-Git , I checked and I think it's a mistake. The import "C" came from nowhere since I did not add it explicitly. Probably it was automatically imported by the IDE. Anyway, my PR should be pure go code and cgo is not needed. You can remove it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants