mirror of
https://github.com/gabehf/Koito.git
synced 2026-04-22 12:01:52 -07:00
Panic if a file for an environment variable cannot be read
This commit is contained in:
parent
8b61b4ec49
commit
13effa050d
1 changed files with 4 additions and 2 deletions
|
|
@ -30,9 +30,11 @@ func readEnvOrFile(envName string) string {
|
|||
if filename != "" {
|
||||
b, err := os.ReadFile(filename)
|
||||
|
||||
if err == nil {
|
||||
envContent = strings.TrimSpace(string(b))
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("Failed to load file for %s_FILE (%s): %s", envName, filename, err))
|
||||
}
|
||||
|
||||
envContent = strings.TrimSpace(string(b))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue