{"modulePath":"github.com/Agent-Field/codeaf","version":"v0.8.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package env\n\nPackage env is the one door for environment variables owned by codeaf.\n\nGet and Lookup are the STATIC door: their names are constants known by the caller and a foreign name is a programming error. Value and LookupValue are the DYNAMIC door: settings tables and key references may contain either a codeaf name or a provider/system name, so foreign names pass through exactly as os records them. Both doors give a CODEAF\\_ name the one-release fallback to its AFORGE\\_ spelling when the new spelling is unset or empty. // legacy-name\n\n## Functions\n\n```go\nfunc EnvironWithout(names ...string) []string\n```\nEnvironWithout returns the process environment without the named variables. Owned names remove both spellings; foreign names remove only themselves.\n\nWHAT IT IS FOR: a child that is not part of some arrangement must not inherit the arrangement's NAMES. A descriptor handed to a child at least shows up in lsof; an inherited variable is invisible, and it travels to every grandchild for the life of the tree.\n\nThe worked case is the heavy-suite lock (cmd/codeaf-suite-lock's suiteEnviron). Exporting the lock's path so the wrapper could read it handed it to the SUITE as well, so every process the suite started tried to take a lock the suite itself was already holding, and refused itself. It made the package untestable from inside a locked box, which is a locking scheme nobody can gate.\n\n```go\nfunc Get(name string) string\n```\nGet reads a statically known codeaf variable with its legacy fallback.\n\n```go\nfunc Legacy(name string) string\n```\nLegacy returns the former spelling of an owned variable.\n\n```go\nfunc Lookup(name string) (string, bool)\n```\nLookup is Get with the presence bit of the spelling that supplied the value.\n\n```go\nfunc LookupValue(name string) (string, bool)\n```\nLookupValue is Value with os.LookupEnv's presence bit.\n\n```go\nfunc Spelling(name string) (string, bool)\n```\nSpelling names the spelling that supplied an owned variable's value: the current one when it is set and non-empty, the former one when only it is set. A receipt that says which variable answered has to say the one the person actually wrote, or it points them at a row they never set. When neither answers it is the current name, unset.\n\n```go\nfunc Value(name string) string\n```\nValue reads a runtime-supplied name. Foreign variables are read plainly.\n\n","path":"github.com/Agent-Field/codeaf/internal/env","name":"env","synopsis":"Package env is the one door for environment variables owned by codeaf.","isRedistributable":true}
