GetEnv retrieves an environment variable with a "BESZEL_AGENT_" prefix, or falls back to the unprefixed key.
(key string)
| 13 | |
| 14 | // GetEnv retrieves an environment variable with a "BESZEL_AGENT_" prefix, or falls back to the unprefixed key. |
| 15 | func GetEnv(key string) (value string, exists bool) { |
| 16 | if value, exists = os.LookupEnv("BESZEL_AGENT_" + key); exists { |
| 17 | return value, exists |
| 18 | } |
| 19 | return os.LookupEnv(key) |
| 20 | } |
| 21 | |
| 22 | // BytesToMegabytes converts bytes to megabytes and rounds to two decimal places. |
| 23 | func BytesToMegabytes(b float64) float64 { |
no outgoing calls