忽略环境变量大小写

This commit is contained in:
Evan 2022-12-16 18:28:35 +09:00
parent 7fa783593a
commit 763b818036

View File

@ -103,7 +103,12 @@ func GetOpenAiApiKey() *string {
}
func getEnv(key string) *string {
value := os.Getenv(strings.ToUpper(key))
value := os.Getenv(key)
if len(value) == 0 {
value = os.Getenv(strings.ToUpper(key))
}
if config == nil {
return nil
}