Getaddrinfo() on glibc calls getenv(), oh boy
this is not a unix beartrap, this is a bug in Go if that&#x27;s where it was found. If your code is multithreaded, it&#x27;s up to you to make it threadsafe. You can&#x27;t declare you&#x27;re creating the most threadsafe memorysafe newbie safe system, and then go home. You have to write the code.<p>Your program gets its own copy of the environment when the program was launched. Nobody is changing it on you, any contention for that resource is you contending with yourself.<p>You don&#x27;t expect an operating system to change things out from under you. Unix doesn&#x27;t. If there is contention for this resource, it&#x27;s all you (or whoever wrote the library you are using)<p>The environment is name-value pairs, as strings. That&#x27;s it. That&#x27;s what makes it accessible and useful. You can swallow it up, the whole thing, into whatever data structure you prefer in your language in a few lines of code, and a millisecond (if that much) of runtime. Just learn how things work and you won&#x27;t feel helpless.