The previous implementation used os.Getenv, which does not differentiate
between an empty and an unset environment variable -- both return the empty
string with os.Getenv.
The new implementation uses syscall.Getenv, which is what os.Getenv uses
directly under the hood. go1.5 introduced os.LookupEnv to solve this exact
problem, but it has not been backported.
The previous implementation used
os.Getenv
, which does not differentiate between an empty and an unset environment variable -- both return the empty string withos.Getenv
.The new implementation uses
syscall.Getenv
, which is whatos.Getenv
uses directly under the hood. go1.5 introducedos.LookupEnv
to solve this exact problem, but it has not been backported.See golang discussion in golang/go#9676.