diff options
author | Jeremy Schlatter <jeremy.schlatter@gmail.com> | 2019-02-19 19:18:37 +0800 |
---|---|---|
committer | Felix Lange <fjl@users.noreply.github.com> | 2019-02-19 19:18:37 +0800 |
commit | b5e5b3567c61ecbfd9094307e4efa53e3be3e23e (patch) | |
tree | 9e9d961b93dad7bce0ae510fce34842603d02f7a /log | |
parent | f7f6a46029c23d2c1b5a5293d470becbdb4e3366 (diff) | |
download | go-tangerine-b5e5b3567c61ecbfd9094307e4efa53e3be3e23e.tar go-tangerine-b5e5b3567c61ecbfd9094307e4efa53e3be3e23e.tar.gz go-tangerine-b5e5b3567c61ecbfd9094307e4efa53e3be3e23e.tar.bz2 go-tangerine-b5e5b3567c61ecbfd9094307e4efa53e3be3e23e.tar.lz go-tangerine-b5e5b3567c61ecbfd9094307e4efa53e3be3e23e.tar.xz go-tangerine-b5e5b3567c61ecbfd9094307e4efa53e3be3e23e.tar.zst go-tangerine-b5e5b3567c61ecbfd9094307e4efa53e3be3e23e.zip |
crypto: fix build when CGO_ENABLED=0 (#19121)
Package crypto works with or without cgo, which is great. However, to make it
work without cgo required setting the build tag `nocgo`. It's common to disable
cgo by instead just setting the environment variable `CGO_ENABLED=0`. Setting
this environment variable does _not_ implicitly set the build tag `nocgo`. So
projects that try to build the crypto package with `CGO_ENABLED=0` will fail. I
have done this myself several times. Until today, I had just assumed that this
meant that this package requires cgo.
But a small build tag change will make this case work. Instead of using `nocgo`
and `!nocgo`, we can use `!cgo` and `cgo`, respectively. The `cgo` build tag is
automatically set if cgo is enabled, and unset if it is disabled.
Diffstat (limited to 'log')
0 files changed, 0 insertions, 0 deletions