diff options
Diffstat (limited to 'pkg/datamaps/config.go')
-rw-r--r-- | pkg/datamaps/config.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/pkg/datamaps/config.go b/pkg/datamaps/config.go index 7c7f8e7..694fec4 100644 --- a/pkg/datamaps/config.go +++ b/pkg/datamaps/config.go @@ -30,9 +30,10 @@ type dbPathChecker struct { getUserConfigDir GetUserConfigDir } -// NewDBPathChecker creaes a DBPathChecker using whatever -// func you want as the argument, as long as it produces -// the user config directory. +// NewDBPathChecker creates a DBPathChecker using whatever +// func you want as the argument, as long as it matches the +// type os.UserConfigDir. This makes it convenient for testing +// and was done as an experiment here to practice mocking in Go. func NewDBPathChecker(h GetUserConfigDir) *dbPathChecker { return &dbPathChecker{getUserConfigDir: h} } @@ -76,7 +77,7 @@ func SetUp() (string, error) { return "", err } log.Printf("Creating database file at %s\n", dbPath) - _, err := SetupDB(dbPath) + _, err := setupDB(dbPath) if err != nil { return "", err } |