How to enable CGO for one module only

My project was working fine with CGO_ENABLED=0.
Now for a new requirement, I need to import a module, the new module imports C and requires CGO enabled. Is there a way to only enable CGO for this new module during go build?

Making CGO_ENABLED=1 for the whole project caused problem in my container - standard_init_linux.go:178: exec user process caused "no such file or directory"

Any help is appreciated!

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.