MCPcopy Index your code
hub / github.com/cortexlabs/cortex / IntFromEnvOrFile

Function IntFromEnvOrFile

pkg/lib/configreader/int.go:145–151  ·  view source on GitHub ↗
(envVarName string, filePath string, v *IntValidation)

Source from the content-addressed store, hash-verified

143}
144
145func IntFromEnvOrFile(envVarName string, filePath string, v *IntValidation) (int, error) {
146 valStr := ReadEnvVar(envVarName)
147 if valStr != nil && *valStr != "" {
148 return IntFromEnv(envVarName, v)
149 }
150 return IntFromFile(filePath, v)
151}
152
153func IntFromPrompt(promptOpts *prompt.Options, v *IntValidation) (int, error) {
154 promptOpts.DefaultStr = s.Int(v.Default)

Callers 1

MustIntFromEnvOrFileFunction · 0.85

Calls 3

ReadEnvVarFunction · 0.85
IntFromEnvFunction · 0.85
IntFromFileFunction · 0.85

Tested by

no test coverage detected