You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
we use env variables as switches for many reasons some of them include
feasibility from implementation persepective
feature/switch does not need a flag (at least yet)
making library/SDK related switches available in downstream tools (ex: DEBUG=true for errorutil will print stacktrace)
when env are registered/consumed from this implementation . all envs are available in help section of that tool (ex: nuclei -h envs) or something similar
while goflags is primary developed for tools and not SDKs . this feature should be possible to be used in libraries without the need of making it a tool (see implementation) . this way all inherited envs are available in downstream tools
Implementation
unlike flags this feature should be registred through global functions instead of methods from flagSet Type/Object etc (see ^ 3)
Proposed Changes
we use env variables as switches for many reasons some of them include
when env are registered/consumed from this implementation . all envs are available in help section of that tool (ex: nuclei -h envs) or something similar
while goflags is primary developed for tools and not SDKs . this feature should be possible to be used in libraries without the need of making it a tool (see implementation) . this way all inherited envs are available in downstream tools
Implementation
unlike flags this feature should be registred through global functions instead of methods from
flagSet
Type/Object etc (see ^ 3)below is example of using this in a library/tool
since go executes in following behaviour
global variables -> init() -> main() ------->
there shouldn't be any trouble with logicexpected output is something similar to this
The text was updated successfully, but these errors were encountered: