f56aa20014
This moves all the env var reading into one central module and logs the loaded config once at startup which should help in troubleshooting user server logs
20 lines
337 B
Go
20 lines
337 B
Go
package envconfig
|
|
|
|
import (
|
|
"os"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestConfig(t *testing.T) {
|
|
os.Setenv("OLLAMA_DEBUG", "")
|
|
LoadConfig()
|
|
require.False(t, Debug)
|
|
os.Setenv("OLLAMA_DEBUG", "false")
|
|
LoadConfig()
|
|
require.False(t, Debug)
|
|
os.Setenv("OLLAMA_DEBUG", "1")
|
|
LoadConfig()
|
|
require.True(t, Debug)
|
|
}
|