![Daniel Hiltgen](/assets/img/avatar_default.png)
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
21 lines
337 B
Go
21 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)
|
|
}
|