Whether CGO is enabled or not affects how reliable certain standard library 
functions are. For example, os/user.LookupGroupId is untrustworthy if CGO 
is not enabled (example 1 <https://github.com/twpayne/chezmoi/issues/65>, 
example 
2 <https://github.com/twpayne/chezmoi/issues/125>).

I can use build flags and two separate source files to determine whether 
CGO is enabled or not, for example in this commit 
<https://github.com/twpayne/chezmoi/pull/127/commits/7a88b1272ccd1247b01b707578022fee988244a5>
.

This feels like it should be part of runtime, like runtime.GOOS and 
runtime.GOARCH.

Is there a better way to determine whether CGO is enabled?

Cheers,
Tom

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to