MCPcopy Create free account
hub / github.com/codealong-dev/ride-sharing / GetInt

Function GetInt

shared/env/env.go:20–32  ·  view source on GitHub ↗
(key string, fallback int)

Source from the content-addressed store, hash-verified

18}
19
20func GetInt(key string, fallback int) int {
21 val, ok := os.LookupEnv(key)
22 if !ok {
23 return fallback
24 }
25
26 valAsInt, err := strconv.Atoi(val)
27 if err != nil {
28 return fallback
29 }
30
31 return valAsInt
32}
33
34func GetBool(key string, fallback bool) bool {
35 val, ok := os.LookupEnv(key)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected