Load config from file with defaults

This commit is contained in:
Dan Jones 2024-02-04 18:19:19 -06:00
commit 40f9518611
8 changed files with 127 additions and 2 deletions

18
config/default_test.go Normal file
View file

@ -0,0 +1,18 @@
package config
import (
"os"
fp "path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestDefaultConfig(t *testing.T) {
home, _ := os.UserHomeDir()
inDir := fp.Join(home, "my-log")
c, err := DefaultConfig()
require.NoError(t, err)
assert.Equal(t, inDir, c.Input.Path)
}