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

Function IntPtrFromEnvOrFile

pkg/lib/configreader/int_ptr.go:152–158  ·  view source on GitHub ↗
(envVarName string, filePath string, v *IntPtrValidation)

Source from the content-addressed store, hash-verified

150}
151
152func IntPtrFromEnvOrFile(envVarName string, filePath string, v *IntPtrValidation) (*int, error) {
153 valStr := ReadEnvVar(envVarName)
154 if valStr != nil && *valStr != "" {
155 return IntPtrFromEnv(envVarName, v)
156 }
157 return IntPtrFromFile(filePath, v)
158}
159
160func IntPtrFromPrompt(promptOpts *prompt.Options, v *IntPtrValidation) (*int, error) {
161 if v.Default != nil && promptOpts.DefaultStr == "" {

Callers

nothing calls this directly

Calls 3

ReadEnvVarFunction · 0.85
IntPtrFromEnvFunction · 0.85
IntPtrFromFileFunction · 0.85

Tested by

no test coverage detected