WithFlag adds a standard flag to the global flag instance that allows configuration of the default socket. Users who call Default() must call this function before flags are parsed, for example in an init() block.

When selecting the default bind string, this function will examine its environment for hints about what port to bind to, selecting the GOJI_BIND environment variable, Einhorn, systemd, the PORT environment variable, and the value of DefaultBind, in order. In most cases, this means that the default behavior of the default socket will be reasonable for use in your circumstance.

WithFlag is referenced in 8 repositories