MCPcopy Index your code
hub / github.com/PatchMon/PatchMon / getEnvInt

Function getEnvInt

server-source-code/internal/config/config.go:339–349  ·  view source on GitHub ↗
(key string, defaultVal int)

Source from the content-addressed store, hash-verified

337}
338
339func getEnvInt(key string, defaultVal int) int {
340 s := os.Getenv(key)
341 if s == "" {
342 return defaultVal
343 }
344 v, err := strconv.Atoi(s)
345 if err != nil {
346 return defaultVal
347 }
348 return v
349}
350
351// getEnvBytes parses size strings like "5mb", "2mb", "1gb" into bytes.
352// defaultMB is used when env is empty or parse fails.

Callers 1

LoadFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected