MCPcopy Create free account
hub / github.com/cortexlabs/cortex / Int32FromEnvOrFile

Function Int32FromEnvOrFile

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

Source from the content-addressed store, hash-verified

143}
144
145func Int32FromEnvOrFile(envVarName string, filePath string, v *Int32Validation) (int32, error) {
146 valStr := ReadEnvVar(envVarName)
147 if valStr != nil && *valStr != "" {
148 return Int32FromEnv(envVarName, v)
149 }
150 return Int32FromFile(filePath, v)
151}
152
153func Int32FromPrompt(promptOpts *prompt.Options, v *Int32Validation) (int32, error) {
154 promptOpts.DefaultStr = s.Int32(v.Default)

Callers 1

MustInt32FromEnvOrFileFunction · 0.85

Calls 3

ReadEnvVarFunction · 0.85
Int32FromEnvFunction · 0.85
Int32FromFileFunction · 0.85

Tested by

no test coverage detected