Hacker News new | ask | show | jobs
by tonyplee 4258 days ago
I have been playing around with go and found this issue. http://stackoverflow.com/questions/26411121/go-calling-c-fun...

Folks from SO gave very good explanation on why.

But because of the problem, I somehow felt cgo is like a "hack" because of the requirement that the C block code is in comments block and must be immediately follow by import "C". An additional empty line before import will cause the code build to fail.

What do you guys think?

p.s. Now I know requirement and I can live with it.

But for a full day, I have hard time figure out why my code build ok and next moment after some "cleanup" it won't build anymore. Not until I finally id the line space is real reason the build fail.

The error message also doesn't make any sense.