MCPcopy
hub / github.com/grafana/tempo / intFromEnv

Function intFromEnv

pkg/tempopb/prealloc.go:53–67  ·  view source on GitHub ↗
(env string, defaultValue int)

Source from the content-addressed store, hash-verified

51}
52
53func intFromEnv(env string, defaultValue int) int {
54 // get the value from the environment
55 val, ok := os.LookupEnv(env)
56 if !ok {
57 return defaultValue
58 }
59
60 // try to parse the value
61 intVal, err := strconv.Atoi(val)
62 if err != nil {
63 panic("failed to parse " + env + " as int")
64 }
65
66 return intVal
67}

Callers 1

initFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected